From 0fb7c659f2e6227b13aa811eba654e06d859cb23 Mon Sep 17 00:00:00 2001 From: nrobi144 Date: Tue, 28 Apr 2026 14:19:04 +0300 Subject: [PATCH] fix(multi-account): persist loaded account to encrypted storage on startup loadSavedAccount() reads from legacy files (last_account.txt) but never wrote to the encrypted multi-account storage, so the account switcher dropdown was always empty after restart. Now calls ensureCurrentAccountInStorage() + refreshAccountList() after successful load so the current account appears in the dropdown. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt index 59ef6d07c..1b665d88e 100644 --- a/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt +++ b/desktopApp/src/jvmMain/kotlin/com/vitorpamplona/amethyst/desktop/Main.kt @@ -672,6 +672,10 @@ fun App( } val result = accountManager.loadSavedAccount() if (result.isSuccess) { + // Ensure loaded account is in multi-account storage + accountManager.ensureCurrentAccountInStorage() + accountManager.refreshAccountList() + val current = accountManager.currentAccount() if (current?.signerType is com.vitorpamplona.amethyst.commons.model.account.SignerType.Remote) { accountManager.startHeartbeat(scope)