Skip to content

Commit f3798b1

Browse files
committed
app: On launch, go to the last visited account
Fixes: #524
1 parent 35f423c commit f3798b1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/widgets/app.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,12 @@ class _ZulipAppState extends State<ZulipApp> with WidgetsBindingObserver {
211211
}
212212

213213
final globalStore = GlobalStoreWidget.of(context);
214-
// TODO(#524) choose initial account as last one used
215-
final initialAccountId = globalStore.accounts.firstOrNull?.id;
214+
final lastAccountId = globalStore.lastVisitedAccountId;
216215
return [
217-
if (initialAccountId == null)
216+
if (lastAccountId == null)
218217
MaterialWidgetRoute(page: const ChooseAccountPage())
219218
else
220-
HomePage.buildRoute(accountId: initialAccountId),
219+
HomePage.buildRoute(accountId: lastAccountId),
221220
];
222221
}
223222

0 commit comments

Comments
 (0)