mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-11 08:08:00 -06:00
fix: Small fix related to account switching
This commit is contained in:
@@ -203,15 +203,8 @@ class ManageAccountsPage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onSwitchAccount(BuildContext context, String currentUser, String newUser) async {
|
_onSwitchAccount(BuildContext context, String currentUser, String newUser) async {
|
||||||
final navigator = Navigator.of(context);
|
|
||||||
if (currentUser == newUser) return;
|
if (currentUser == newUser) return;
|
||||||
Navigator.pushReplacement(
|
Navigator.of(context).pop();
|
||||||
context,
|
context.read<AuthenticationCubit>().switchAccount(newUser);
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) => const SwitchingAccountsPage(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
await context.read<AuthenticationCubit>().switchAccount(newUser);
|
|
||||||
navigator.popUntil((route) => route.isFirst);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user