diff --git a/packages/neon_framework/lib/src/blocs/apps.dart b/packages/neon_framework/lib/src/blocs/apps.dart index 0a9f450d0af..24455366441 100644 --- a/packages/neon_framework/lib/src/blocs/apps.dart +++ b/packages/neon_framework/lib/src/blocs/apps.dart @@ -13,6 +13,7 @@ import 'package:neon_framework/src/models/app_implementation.dart'; import 'package:neon_framework/src/models/notifications_interface.dart'; import 'package:neon_framework/src/utils/findable.dart'; import 'package:neon_framework/src/utils/request_manager.dart'; +import 'package:neon_framework/src/utils/server_version.dart'; import 'package:nextcloud/core.dart' as core; import 'package:nextcloud/nextcloud.dart'; import 'package:provider/provider.dart'; @@ -170,7 +171,7 @@ class _AppsBloc extends InteractiveBloc implements AppsBloc { final notSupported = MapBuilder(); final coreCheck = account.client.core.getVersionCheck(capabilities.requireData); - if (!coreCheck.isSupported && !capabilities.requireData.version.string.contains('dev')) { + if (!coreCheck.isSupported && !isDevelopmentServerVersion(capabilities.requireData.version.string)) { notSupported['core'] = coreCheck; } diff --git a/packages/neon_framework/lib/src/pages/login_check_server_status.dart b/packages/neon_framework/lib/src/pages/login_check_server_status.dart index 0bb360ddd76..8722650ab6d 100644 --- a/packages/neon_framework/lib/src/pages/login_check_server_status.dart +++ b/packages/neon_framework/lib/src/pages/login_check_server_status.dart @@ -5,6 +5,7 @@ import 'package:neon_framework/src/bloc/result.dart'; import 'package:neon_framework/src/blocs/login_check_server_status.dart'; import 'package:neon_framework/src/router.dart'; import 'package:neon_framework/src/theme/dialog.dart'; +import 'package:neon_framework/src/utils/server_version.dart'; import 'package:neon_framework/src/widgets/error.dart'; import 'package:neon_framework/src/widgets/validation_tile.dart'; import 'package:nextcloud/core.dart' as core; @@ -112,7 +113,7 @@ class _LoginCheckServerStatusPageState extends State } bool _isServerVersionAllowed(core.Status status) => - status.versionCheck.isSupported || status.versionstring.contains('dev'); + status.versionCheck.isSupported || isDevelopmentServerVersion(status.versionstring); Widget _buildServerVersionTile(Result result) { if (result.hasError) { diff --git a/packages/neon_framework/lib/src/utils/server_version.dart b/packages/neon_framework/lib/src/utils/server_version.dart new file mode 100644 index 00000000000..8fb1b8f956f --- /dev/null +++ b/packages/neon_framework/lib/src/utils/server_version.dart @@ -0,0 +1,4 @@ +/// Checks whether the server [version] is a dev, beta or RC version. +bool isDevelopmentServerVersion(String version) { + return version.contains('dev') || version.contains('beta') || version.contains('RC'); +}