diff --git a/lib/ui/app/menu_drawer_vm.dart b/lib/ui/app/menu_drawer_vm.dart index 69053b4aa..0e78fac9a 100644 --- a/lib/ui/app/menu_drawer_vm.dart +++ b/lib/ui/app/menu_drawer_vm.dart @@ -73,10 +73,10 @@ class MenuDrawerVM { message: AppLocalization.of(context).logout, context: context, callback: () async { - if (store.state.user.isConnectedToGoogle) { - await googleSignOut(); - } store.dispatch(UserLogout(context)); + if (store.state.user.isConnectedToGoogle) { + googleSignOut(); + } }); }, onCompanyChanged: diff --git a/lib/ui/settings/user_details_vm.dart b/lib/ui/settings/user_details_vm.dart index 427c0f90b..a612db48f 100644 --- a/lib/ui/settings/user_details_vm.dart +++ b/lib/ui/settings/user_details_vm.dart @@ -79,8 +79,7 @@ class UserDetailsVM { callback: () { passwordCallback( context: context, - callback: (password, idToken) async { - await googleSignOut(); + callback: (password, idToken) { store.dispatch( SaveAuthUserRequest( user: state.user.rebuild((b) => b..oauthProvider = ''), @@ -89,6 +88,7 @@ class UserDetailsVM { completer: completer, ), ); + googleSignOut(); }); }); }, diff --git a/lib/utils/oauth.dart b/lib/utils/oauth.dart index 75c4bdf23..666f78542 100644 --- a/lib/utils/oauth.dart +++ b/lib/utils/oauth.dart @@ -31,9 +31,5 @@ void googleSignUp(Function(String, String, String) callback) async { } Future googleSignOut() async { - if (!await _googleSignIn.isSignedIn()) { - return null; - } - return await _googleSignIn.signOut(); }