diff --git a/i18n/en.json b/i18n/en.json index 39b22eab2c..90ce897dd9 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -470,6 +470,7 @@ "app_bar_signout_dialog_ok": "Yes", "app_bar_signout_dialog_title": "Sign out", "app_settings": "App Settings", + "app_update_available": "An app update is available.", "appears_in": "Appears in", "apply_count": "Apply ({count, number})", "archive": "Archive", @@ -1546,12 +1547,9 @@ "privacy": "Privacy", "profile": "Profile", "profile_drawer_app_logs": "Logs", - "profile_drawer_client_out_of_date": "An app update is available.", "profile_drawer_client_server_up_to_date": "Client and Server are up-to-date", "profile_drawer_github": "GitHub", "profile_drawer_readonly_mode": "Read-only mode enabled. Long-press the user avatar icon to exit.", - "profile_drawer_server_out_of_date": "A server update is available.", - "profile_drawer_unable_to_check_version": "Unable to check app or server version", "profile_image_of_user": "Profile image of {user}", "profile_picture_set": "Profile picture set.", "public_album": "Public album", @@ -1780,6 +1778,7 @@ "server_online": "Server Online", "server_privacy": "Server Privacy", "server_stats": "Server Stats", + "server_update_available": "A server update is available.", "server_version": "Server Version", "set": "Set", "set_as_album_cover": "Set as album cover", @@ -2021,6 +2020,7 @@ "troubleshoot": "Troubleshoot", "type": "Type", "unable_to_change_pin_code": "Unable to change PIN code", + "unable_to_check_version": "Unable to check app or server version", "unable_to_setup_pin_code": "Unable to setup PIN code", "unarchive": "Unarchive", "unarchive_action_prompt": "{count} removed from Archive", diff --git a/mobile/lib/constants/constants.dart b/mobile/lib/constants/constants.dart index 7429616f14..10f4e88f0f 100644 --- a/mobile/lib/constants/constants.dart +++ b/mobile/lib/constants/constants.dart @@ -49,3 +49,7 @@ const double kUploadStatusFailed = -1.0; const double kUploadStatusCanceled = -2.0; const int kMinMonthsToEnableScrubberSnap = 12; + +const String kImmichAppStoreLink = "https://apps.apple.com/app/immich/id6449244941"; +const String kImmichPlayStoreLink = "https://play.google.com/store/apps/details?id=app.alextran.immich"; +const String kImmichLatestRelease = "https://github.com/immich-app/immich/releases/latest"; diff --git a/mobile/lib/providers/server_info.provider.dart b/mobile/lib/providers/server_info.provider.dart index 88d250ae10..1c44d32d9e 100644 --- a/mobile/lib/providers/server_info.provider.dart +++ b/mobile/lib/providers/server_info.provider.dart @@ -47,20 +47,14 @@ class ServerInfoNotifier extends StateNotifier { // using isClientOutOfDate since that will show to users reguardless of if they are an admin if (serverVersion == null) { - state = state.copyWith( - errorGettingVersions: true, - versionMismatchErrorMessage: "profile_drawer_unable_to_check_version".tr(), - ); + state = state.copyWith(errorGettingVersions: true, versionMismatchErrorMessage: "unable_to_check_version".tr()); return; } await _checkServerVersionMismatch(serverVersion); } catch (e, stackTrace) { _log.severe("Failed to get server version", e, stackTrace); - state = state.copyWith( - errorGettingVersions: true, - versionMismatchErrorMessage: "profile_drawer_unable_to_check_version".tr(), - ); + state = state.copyWith(errorGettingVersions: true, versionMismatchErrorMessage: "unable_to_check_version".tr()); return; } } @@ -73,18 +67,12 @@ class ServerInfoNotifier extends StateNotifier { Map appVersion = _getDetailVersion(packageInfo.version); if (appVersion["major"]! > serverVersion.major || appVersion["minor"]! > serverVersion.minor) { - state = state.copyWith( - isServerOutOfDate: true, - versionMismatchErrorMessage: "profile_drawer_server_out_of_date".tr(), - ); + state = state.copyWith(isServerOutOfDate: true, versionMismatchErrorMessage: "server_update_available".tr()); return; } if (appVersion["major"]! < serverVersion.major || appVersion["minor"]! < serverVersion.minor) { - state = state.copyWith( - isClientOutOfDate: true, - versionMismatchErrorMessage: "profile_drawer_client_out_of_date".tr(), - ); + state = state.copyWith(isClientOutOfDate: true, versionMismatchErrorMessage: "app_update_available".tr()); return; } diff --git a/mobile/lib/widgets/common/app_bar_dialog/app_bar_server_info.dart b/mobile/lib/widgets/common/app_bar_dialog/app_bar_server_info.dart index 075c7a00cb..54c6aaf3c7 100644 --- a/mobile/lib/widgets/common/app_bar_dialog/app_bar_server_info.dart +++ b/mobile/lib/widgets/common/app_bar_dialog/app_bar_server_info.dart @@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart' hide Store; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:immich_mobile/constants/constants.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart'; import 'package:immich_mobile/extensions/theme_extensions.dart'; import 'package:immich_mobile/models/server_info/server_info.model.dart'; @@ -48,16 +49,16 @@ class AppBarServerInfo extends HookConsumerWidget { return; } + String url; if (Platform.isIOS) { - launchUrl(Uri.parse("https://apps.apple.com/app/id1613945652"), mode: LaunchMode.externalApplication); + url = kImmichAppStoreLink; } else if (Platform.isAndroid) { - launchUrl( - Uri.parse("https://play.google.com/store/apps/details?id=app.alextran.immich"), - mode: LaunchMode.externalApplication, - ); + url = kImmichPlayStoreLink; } else { - launchUrl(Uri.parse("https://immich.app/download"), mode: LaunchMode.externalApplication); + url = kImmichLatestRelease; } + + launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication); } useEffect(() {