2026-06-22 10:28:56 -05:00
|
|
|
import 'package:immich_mobile/utils/semver.dart';
|
|
|
|
|
|
2026-06-30 13:44:53 -05:00
|
|
|
String? getVersionCompatibilityMessage({required SemVer serverVersion, required SemVer appVersion}) {
|
2024-06-10 12:43:54 -05:00
|
|
|
// Add latest compat info up top
|
2026-06-22 10:28:56 -05:00
|
|
|
|
|
|
|
|
// ensure mobile app major version is not behind server major version
|
|
|
|
|
if (appVersion.major < serverVersion.major) {
|
|
|
|
|
return 'Your mobile app version is not compatible with the server! Please update your mobile app to the latest version.';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ensure mobile app major version is not ahead of server major version by more than 1 major version
|
|
|
|
|
if (appVersion.major > serverVersion.major + 1) {
|
|
|
|
|
return 'Your server version is not compatible with the mobile app! Please update your server to the latest version.';
|
2024-06-10 12:43:54 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|