chore: clear init completer in userController on logout (#1993)
This commit is contained in:
parent
56b2d132e1
commit
c67c35e4f0
2 changed files with 7 additions and 2 deletions
|
|
@ -157,6 +157,7 @@ class PangeaController {
|
|||
// Reset cached analytics data
|
||||
putAnalytics.dispose();
|
||||
getAnalytics.dispose();
|
||||
userController.clear();
|
||||
_languageStream?.cancel();
|
||||
break;
|
||||
case LoginState.loggedIn:
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue