Browse Source

feat(neon): Define multiple fallback apps

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/940/head
jld3103 1 year ago
parent
commit
a53f81f97c
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 11
      packages/neon/neon/lib/src/blocs/apps.dart

11
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;
}

Loading…
Cancel
Save