diff --git a/lib/widgets/app.dart b/lib/widgets/app.dart index 12e83d1285f..38399b04b41 100644 --- a/lib/widgets/app.dart +++ b/lib/widgets/app.dart @@ -13,7 +13,6 @@ import 'about_zulip.dart'; import 'actions.dart'; import 'dialog.dart'; import 'home.dart'; -import 'inbox.dart'; import 'login.dart'; import 'page.dart'; import 'store.dart'; @@ -209,11 +208,10 @@ class _ZulipAppState extends State with WidgetsBindingObserver { onGenerateInitialRoutes: (_) { return [ - MaterialWidgetRoute(page: const ChooseAccountPage()), - if (initialAccountId != null) ...[ + if (initialAccountId != null) HomePage.buildRoute(accountId: initialAccountId), - InboxPage.buildRoute(accountId: initialAccountId), - ], + if (initialAccountId == null) + MaterialWidgetRoute(page: const ChooseAccountPage()), ]; }); })); diff --git a/test/notifications/display_test.dart b/test/notifications/display_test.dart index 202beba5e55..6924190a9af 100644 --- a/test/notifications/display_test.dart +++ b/test/notifications/display_test.dart @@ -22,7 +22,6 @@ import 'package:zulip/notifications/receive.dart'; import 'package:zulip/widgets/app.dart'; import 'package:zulip/widgets/color.dart'; import 'package:zulip/widgets/home.dart'; -import 'package:zulip/widgets/inbox.dart'; import 'package:zulip/widgets/message_list.dart'; import 'package:zulip/widgets/page.dart'; import 'package:zulip/widgets/theme.dart'; @@ -930,15 +929,13 @@ void main() { void takeStartingRoutes({bool withAccount = true}) { final expected = >[ - (it) => it.isA().page.isA(), if (withAccount) ...[ (it) => it.isA() ..accountId.equals(eg.selfAccount.id) ..page.isA(), - (it) => it.isA() - ..accountId.equals(eg.selfAccount.id) - ..page.isA(), ], + if (!withAccount) + (it) => it.isA().page.isA(), ]; check(pushedRoutes.take(expected.length)).deepEquals(expected); pushedRoutes.removeRange(0, expected.length); diff --git a/test/widgets/app_test.dart b/test/widgets/app_test.dart index b3bd1eebe98..751a30d516d 100644 --- a/test/widgets/app_test.dart +++ b/test/widgets/app_test.dart @@ -5,7 +5,6 @@ import 'package:zulip/log.dart'; import 'package:zulip/model/database.dart'; import 'package:zulip/widgets/app.dart'; import 'package:zulip/widgets/home.dart'; -import 'package:zulip/widgets/inbox.dart'; import 'package:zulip/widgets/page.dart'; import '../example_data.dart' as eg; @@ -40,7 +39,7 @@ void main() { ]); }); - testWidgets('when have accounts, go to inbox for first account', (tester) async { + testWidgets('when have accounts, go to home page for first account', (tester) async { addTearDown(testBinding.reset); // We'll need per-account data for the account that a page will be opened @@ -49,13 +48,9 @@ void main() { await testBinding.globalStore.insertAccount(eg.otherAccount.toCompanion(false)); check(await initialRoutes(tester)).deepEquals(>[ - (it) => it.isA().page.isA(), (it) => it.isA() ..accountId.equals(eg.selfAccount.id) ..page.isA(), - (it) => it.isA() - ..accountId.equals(eg.selfAccount.id) - ..page.isA(), ]); }); });