diff --git a/lib/services/auth_service.dart b/lib/services/auth_service.dart index 054f487..bb9e645 100644 --- a/lib/services/auth_service.dart +++ b/lib/services/auth_service.dart @@ -37,6 +37,7 @@ class AccountsService extends ChangeNotifier { for (final p in secretsService.profiles) { if (!p.loggedIn) { _loggedOutProfiles.add(p); + continue; } final pr = await signIn(p.credentials, withNotification: false); @@ -74,7 +75,6 @@ class AccountsService extends ChangeNotifier { serverName: credentialsCache!.serverName, avatar: profileData.avatarUrl, userId: profileData.id, - id: credentials.id, loggedIn: true, ); @@ -102,7 +102,8 @@ class AccountsService extends ChangeNotifier { clearActiveProfile(withNotification: withNotification); } _loggedInProfiles.remove(profile); - secretsService.addOrUpdateProfile(profile); + _loggedOutProfiles.add(profile.copyWithLoginUpdate(false)); + secretsService.addOrUpdateProfile(profile.copyWithLoginUpdate(false)); if (_loggedInProfiles.isNotEmpty) { setActiveProfile( diff --git a/lib/services/secrets_service.dart b/lib/services/secrets_service.dart index 3a6ffeb..8908599 100644 --- a/lib/services/secrets_service.dart +++ b/lib/services/secrets_service.dart @@ -43,6 +43,7 @@ class SecretsService { FutureResult, ExecError> addOrUpdateProfile( Profile profile) async { try { + _cachedProfiles.remove(profile); _cachedProfiles.add(profile); return await saveCredentials(); } on PlatformException catch (e) {