fix: Small fix related to account switching

This commit is contained in:
Anton Stubenbord
2023-05-12 00:40:10 +02:00
parent 891ab8985b
commit 96c4b37f5f

View File

@@ -203,15 +203,8 @@ class ManageAccountsPage extends StatelessWidget {
}
_onSwitchAccount(BuildContext context, String currentUser, String newUser) async {
final navigator = Navigator.of(context);
if (currentUser == newUser) return;
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const SwitchingAccountsPage(),
),
);
await context.read<AuthenticationCubit>().switchAccount(newUser);
navigator.popUntil((route) => route.isFirst);
Navigator.of(context).pop();
context.read<AuthenticationCubit>().switchAccount(newUser);
}
}