Skip to content

Commit

Permalink
feat(neon): Define multiple fallback apps
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <jld3103yt@gmail.com>
  • Loading branch information
provokateurin committed Oct 19, 2023
1 parent 1af2069 commit a53f81f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/neon/neon/lib/src/blocs/apps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a53f81f

Please sign in to comment.