chore: clear init completer in userController on logout (#1993)

This commit is contained in:
ggurdin 2025-02-28 12:03:52 -05:00 committed by GitHub
parent 56b2d132e1
commit c67c35e4f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -157,6 +157,7 @@ class PangeaController {
// Reset cached analytics data
putAnalytics.dispose();
getAnalytics.dispose();
userController.clear();
_languageStream?.cancel();
break;
case LoginState.loggedIn:

View file

@ -169,11 +169,15 @@ class UserController extends BaseController {
}
}
void clear() {
_profileCompleter = null;
_cachedProfile = null;
}
/// Reinitializes the user's profile
/// This method should be called whenever the user's login status changes
Future<void> reinitialize() async {
_profileCompleter = null;
_cachedProfile = null;
clear();
await initialize();
}