mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
chore: code review updates
This commit is contained in:
parent
ce2d3a30a5
commit
6d3e918a7b
4 changed files with 18 additions and 25 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -47,20 +47,14 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {
|
|||
|
||||
// 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<ServerInfo> {
|
|||
Map<String, int> 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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue