mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix(mobile): hide latest version warnings (#26036)
The latest version is already hidden in the server info widget if disabled (https://github.com/immich-app/immich/pull/25691), however I did not realise there are more places where this warning is shown. This hides the warning everywhere, and cleans up the code a bit.
This commit is contained in:
@@ -15,7 +15,6 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {
|
||||
: super(
|
||||
const ServerInfo(
|
||||
serverVersion: ServerVersion(major: 0, minor: 0, patch: 0),
|
||||
latestVersion: null,
|
||||
serverFeatures: ServerFeatures(map: true, trash: true, oauthEnabled: false, passwordLogin: true),
|
||||
serverConfig: ServerConfig(
|
||||
trashDays: 30,
|
||||
@@ -104,7 +103,9 @@ final serverInfoProvider = StateNotifierProvider<ServerInfoNotifier, ServerInfo>
|
||||
|
||||
final versionWarningPresentProvider = Provider.family<bool, UserDto?>((ref, user) {
|
||||
final serverInfo = ref.watch(serverInfoProvider);
|
||||
return serverInfo.versionStatus == VersionStatus.clientOutOfDate ||
|
||||
serverInfo.versionStatus == VersionStatus.error ||
|
||||
((user?.isAdmin ?? false) && serverInfo.versionStatus == VersionStatus.serverOutOfDate);
|
||||
return switch (serverInfo.versionStatus) {
|
||||
VersionStatus.clientOutOfDate || VersionStatus.error => true,
|
||||
VersionStatus.serverOutOfDate => serverInfo.latestVersion != null && (user?.isAdmin ?? false),
|
||||
VersionStatus.upToDate => false,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user