From a53f81f97c9e49a4b7c56890d4005421b6fa647a Mon Sep 17 00:00:00 2001 From: jld3103 Date: Mon, 2 Oct 2023 13:14:28 +0200 Subject: [PATCH] feat(neon): Define multiple fallback apps Signed-off-by: jld3103 --- packages/neon/neon/lib/src/blocs/apps.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index b3716a3a..411e1a77 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -97,9 +97,14 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates /// Returns null when no app is supported by the server. String? _getInitialAppFallback() { final supportedApps = appImplementations.value.requireData; - if (supportedApps.tryFind(AppIDs.files) != null) { - return AppIDs.files; - } else if (supportedApps.isNotEmpty) { + + for (final fallback in {AppIDs.dashboard, AppIDs.files}) { + if (supportedApps.tryFind(fallback) != null) { + return fallback; + } + } + + if (supportedApps.isNotEmpty) { return supportedApps.first.id; }