kopia lustrzana https://gitlab.com/mysocialportal/relatica
Add proper login/out storage/processing on load
rodzic
7c68ee62a4
commit
d1203c53a2
|
@ -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(
|
||||
|
|
|
@ -43,6 +43,7 @@ class SecretsService {
|
|||
FutureResult<List<Profile>, ExecError> addOrUpdateProfile(
|
||||
Profile profile) async {
|
||||
try {
|
||||
_cachedProfiles.remove(profile);
|
||||
_cachedProfiles.add(profile);
|
||||
return await saveCredentials();
|
||||
} on PlatformException catch (e) {
|
||||
|
|
Ładowanie…
Reference in New Issue