Improve: 缩短格式化 JSON 编辑提示时长

* Improve: 调整格式化 JSON 编辑提示频率

* Improve: 减少格式化 JSON 编辑提示次数

---------

Co-authored-by: zipg <4047349+zipg@users.noreply.github.com>
This commit is contained in:
zipg 2026-07-08 12:10:46 +08:00 committed by GitHub
parent 76eab8856f
commit 5b70626cf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -160,7 +160,7 @@ import { SearchableSelect } from "@/components/ui/searchable-select";
const SqlPreviewPanel = defineAsyncComponent(() => import("@/components/editor/SqlPreviewPanel.vue"));
const FORMATTED_JSON_EDIT_WARNING_COUNT_STORAGE_KEY = "dbx-cell-detail-formatted-json-edit-warning-count";
const FORMATTED_JSON_EDIT_WARNING_MAX_COUNT = 10;
const FORMATTED_JSON_EDIT_WARNING_MAX_COUNT = 3;
const { t } = useI18n();
const slots = useSlots();
@ -4987,7 +4987,7 @@ function warnFormattedJsonEditIfNeeded(detail: DataGridCellDetail, force = false
if (!force && (!sideDetailJsonView.value || !detail.formattedJson)) return;
const count = Number(safeLocalStorageGet(FORMATTED_JSON_EDIT_WARNING_COUNT_STORAGE_KEY)) || 0;
if (count >= FORMATTED_JSON_EDIT_WARNING_MAX_COUNT) return;
toast(t("grid.formattedJsonEditWarning"), 10000);
toast(t("grid.formattedJsonEditWarning"), 6000);
safeLocalStorageSet(FORMATTED_JSON_EDIT_WARNING_COUNT_STORAGE_KEY, String(count + 1));
}