High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(mobile): hide latest version if disabled (#25691)
Thomas855817514c4c
diff --git a/mobile/lib/models/server_info/server_info.model.dart b/mobile/lib/models/server_info/server_info.model.dartindex a034960ddb..5d78acb0b8 100644--- a/mobile/lib/models/server_info/server_info.model.dart+++ b/mobile/lib/models/server_info/server_info.model.dart@@ -20,7 +20,7 @@ enum VersionStatus {class ServerInfo {final ServerVersion serverVersion;- final ServerVersion latestVersion;+ final ServerVersion? latestVersion;final ServerFeatures serverFeatures;final ServerConfig serverConfig;final ServerDiskInfo serverDiskInfo;diff --git a/mobile/lib/providers/server_info.provider.dart b/mobile/lib/providers/server_info.provider.dartindex bb201a607c..fba4fa7294 100644--- a/mobile/lib/providers/server_info.provider.dart+++ b/mobile/lib/providers/server_info.provider.dart@@ -15,7 +15,7 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {: super(const ServerInfo(serverVersion: ServerVersion(major: 0, minor: 0, patch: 0),- latestVersion: ServerVersion(major: 0, minor: 0, patch: 0),+ latestVersion: null,serverFeatures: ServerFeatures(map: true, trash: true, oauthEnabled: false, passwordLogin: true),serverConfig: ServerConfig(trashDays: 30,@@ -43,7 +43,7 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {try {final serverVersion = await _serverInfoService.getServerVersion();- // using isClientOutOfDate since that will show to users reguardless of if they are an admin+ // using isClientOutOfDate since that will show to users regardless of if they are an adminif (serverVersion == null) {state = state.copyWith(versionStatus: VersionStatus.error);return;@@ -76,7 +76,7 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {state = state.copyWith(versionStatus: VersionStatus.upToDate);}- handleReleaseInfo(ServerVersion serverVersion, ServerVersion latestVersion) {+ handleReleaseInfo(ServerVersion serverVersion, ServerVersion? latestVersion) {// Update local server version_checkServerVersionMismatch(serverVersion, latestVersion: latestVersion);}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.dartindex a83a3beee3..a341d6395c 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@@ -170,50 +170,52 @@ class AppBarServerInfo extends HookConsumerWidget {),],),- const Padding(padding: EdgeInsets.symmetric(horizontal: 10), child: Divider(thickness: 1)),- Row(- mainAxisAlignment: MainAxisAlignment.spaceBetween,- children: [- Expanded(- child: Padding(- padding: const EdgeInsets.only(left: 10.0),- child: Row(- children: [- if (serverInfoState.versionStatus == VersionStatus.serverOutOfDate)- const Padding(- padding: EdgeInsets.only(right: 5.0),- child: Icon(Icons.info, color: Color.fromARGB(255, 243, 188, 106), size: 12),- ),- Text(- "latest_version".tr(),- style: TextStyle(- fontSize: titleFontSize,- color: context.textTheme.labelSmall?.color,- fontWeight: FontWeight.w500,+ if (serverInfoState.latestVersion != null) ...[+ const Padding(padding: EdgeInsets.symmetric(horizontal: 10), child: Divider(thickness: 1)),+ Row(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ children: [+ Expanded(+ child: Padding(+ padding: const EdgeInsets.only(left: 10.0),+ child: Row(+ children: [+ if (serverInfoState.versionStatus == VersionStatus.serverOutOfDate)+ const Padding(+ padding: EdgeInsets.only(right: 5.0),+ child: Icon(Icons.info, color: Color.fromARGB(255, 243, 188, 106), size: 12),+ ),+ Text(+ "latest_version".tr(),+ style: TextStyle(+ fontSize: titleFontSize,+ color: context.textTheme.labelSmall?.color,+ fontWeight: FontWeight.w500,+ ),),- ),- ],+ ],+ ),),),- ),- Expanded(- flex: 0,- child: Padding(- padding: const EdgeInsets.only(right: 10.0),- child: Text(- serverInfoState.latestVersion.major > 0- ? "${serverInfoState.latestVersion.major}.${serverInfoState.latestVersion.minor}.${serverInfoState.latestVersion.patch}"- : "--",- style: TextStyle(- fontSize: contentFontSize,- color: context.colorScheme.onSurfaceSecondary,- fontWeight: FontWeight.bold,+ Expanded(+ flex: 0,+ child: Padding(+ padding: const EdgeInsets.only(right: 10.0),+ child: Text(+ serverInfoState.latestVersion!.major > 0+ ? "${serverInfoState.latestVersion!.major}.${serverInfoState.latestVersion!.minor}.${serverInfoState.latestVersion!.patch}"+ : "--",+ style: TextStyle(+ fontSize: contentFontSize,+ color: context.colorScheme.onSurfaceSecondary,+ fontWeight: FontWeight.bold,+ ),),),),- ),- ],- ),+ ],+ ),+ ],],),),