1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 22:51:59 +00:00

fix(mobile): warning message not resetting when changing server URL (#10112)

This commit is contained in:
Alex 2024-06-11 05:48:49 -05:00 committed by GitHub
parent 8a866297f7
commit 04808f8b5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,7 +54,7 @@ class LoginForm extends HookConsumerWidget {
duration: const Duration(seconds: 60),
)..repeat();
final serverInfo = ref.watch(serverInfoProvider);
final warningMessage = useState<String>('');
final warningMessage = useState<String?>(null);
final ValueNotifier<String?> serverEndpoint = useState<String?>(null);
@ -67,16 +67,12 @@ class LoginForm extends HookConsumerWidget {
final serverMajorVersion = serverInfo.serverVersion.major;
final serverMinorVersion = serverInfo.serverVersion.minor;
final message = getVersionCompatibilityMessage(
warningMessage.value = getVersionCompatibilityMessage(
appMajorVersion,
appMinorVersion,
serverMajorVersion,
serverMinorVersion,
);
if (message != null) {
warningMessage.value = message;
}
} catch (error) {
warningMessage.value = 'Error checking version compatibility';
}
@ -345,7 +341,7 @@ class LoginForm extends HookConsumerWidget {
buildVersionCompatWarning() {
checkVersionMismatch();
if (warningMessage.value.isEmpty) {
if (warningMessage.value == null) {
return const SizedBox.shrink();
}
@ -363,7 +359,7 @@ class LoginForm extends HookConsumerWidget {
),
),
child: Text(
warningMessage.value,
warningMessage.value!,
textAlign: TextAlign.center,
),
),