From 49a4b34eb392fa2ff745a4f8a2f943db03c1e49a Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Sat, 19 Apr 2025 09:46:38 +0800 Subject: [PATCH] update --- packages/frontend/src/views/SettingsView.vue | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/frontend/src/views/SettingsView.vue b/packages/frontend/src/views/SettingsView.vue index 61d7903..8d654ce 100644 --- a/packages/frontend/src/views/SettingsView.vue +++ b/packages/frontend/src/views/SettingsView.vue @@ -259,13 +259,9 @@ watch(settings, (newSettings, oldSettings) => { blacklistSettingsForm.maxLoginAttempts = newSettings.maxLoginAttempts || '5'; blacklistSettingsForm.loginBanDuration = newSettings.loginBanDuration || '300'; - // Initialize local state only on initial load or if store changes externally - if (isInitialLoad || newSettings.showPopupFileEditor !== oldSettings?.showPopupFileEditor) { - popupEditorEnabled.value = showPopupFileEditorBoolean.value; - } - if (isInitialLoad || newSettings.shareFileEditorTabs !== oldSettings?.shareFileEditorTabs) { - shareTabsEnabled.value = shareFileEditorTabsBoolean.value; - } + // 始终将本地布尔状态与 store 的布尔 getter 同步 + popupEditorEnabled.value = showPopupFileEditorBoolean.value; + shareTabsEnabled.value = shareFileEditorTabsBoolean.value; }, { deep: true, immediate: true }); // immediate: true to run on initial load