From 009e4391c2596070a8ba08c49dbfb91a8b686ebd Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Sat, 18 Apr 2026 09:10:22 +0800 Subject: [PATCH] fix(settings): force save snapshot after account sync to ensure persistence of tokens and bridge URL --- lib/runtime/runtime_controllers_settings_account_impl.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/runtime/runtime_controllers_settings_account_impl.dart b/lib/runtime/runtime_controllers_settings_account_impl.dart index 799e205b..33872432 100644 --- a/lib/runtime/runtime_controllers_settings_account_impl.dart +++ b/lib/runtime/runtime_controllers_settings_account_impl.dart @@ -337,9 +337,10 @@ Future syncAccountSettingsInternal( final sanitizedSettings = _sanitizeBridgeOnlyAccountSyncSettings( currentSettings.copyWith(acpBridgeServerModeConfig: nextModeConfig), ); - if (sanitizedSettings.toJsonString() != currentSettings.toJsonString()) { - await controller.saveSnapshot(sanitizedSettings); - } + // Always save the snapshot after a successful sync to ensure Token and URL updates + // are correctly persisted in the store and reflected in the UI. + await controller.saveSnapshot(sanitizedSettings); + await controller.reloadDerivedStateInternal(); final email = controller.accountSessionInternal?.email.trim() ?? ''; controller.accountStatusInternal = email.isEmpty