mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-25 07:25:27 -04:00
Fix routing to home after initial account creation
This commit is contained in:
parent
f4407e5284
commit
e1f081105a
3 changed files with 27 additions and 16 deletions
|
@ -63,10 +63,13 @@ class _NewAccountPageState extends WindowSetupState<NewAccountPage> {
|
|||
return false;
|
||||
}
|
||||
|
||||
final isFirstAccount =
|
||||
AccountRepository.instance.getLocalAccounts().isEmpty;
|
||||
|
||||
final writableSuperIdentity = await AccountRepository.instance
|
||||
.createWithNewSuperIdentity(accountSpec);
|
||||
GoRouterHelper(context).pushReplacement('/new_account/recovery_key',
|
||||
extra: [writableSuperIdentity, accountSpec.name]);
|
||||
extra: [writableSuperIdentity, accountSpec.name, isFirstAccount]);
|
||||
|
||||
return true;
|
||||
} finally {
|
||||
|
@ -92,11 +95,15 @@ class _NewAccountPageState extends WindowSetupState<NewAccountPage> {
|
|||
return StyledScaffold(
|
||||
appBar: DefaultAppBar(
|
||||
title: Text(translate('new_account_page.titlebar')),
|
||||
leading: Navigator.canPop(context)
|
||||
leading: GoRouterHelper(context).canPop()
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
if (GoRouterHelper(context).canPop()) {
|
||||
GoRouterHelper(context).pop();
|
||||
} else {
|
||||
GoRouterHelper(context).go('/');
|
||||
}
|
||||
},
|
||||
)
|
||||
: null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue