Skip to content

Commit

Permalink
Merge pull request #1773 from nextcloud/fix/neon_framework/allow-beta…
Browse files Browse the repository at this point in the history
…-rc-server-versions
  • Loading branch information
provokateurin authored Mar 14, 2024
2 parents 7d3ef90 + ed2700b commit bf2c1f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/neon_framework/lib/src/blocs/apps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -170,7 +171,7 @@ class _AppsBloc extends InteractiveBloc implements AppsBloc {
final notSupported = MapBuilder<String, VersionCheck>();

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -112,7 +113,7 @@ class _LoginCheckServerStatusPageState extends State<LoginCheckServerStatusPage>
}

bool _isServerVersionAllowed(core.Status status) =>
status.versionCheck.isSupported || status.versionstring.contains('dev');
status.versionCheck.isSupported || isDevelopmentServerVersion(status.versionstring);

Widget _buildServerVersionTile(Result<core.Status> result) {
if (result.hasError) {
Expand Down
4 changes: 4 additions & 0 deletions packages/neon_framework/lib/src/utils/server_version.dart
Original file line number Diff line number Diff line change
@@ -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');
}

0 comments on commit bf2c1f7

Please sign in to comment.