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:
parent
8a866297f7
commit
04808f8b5c
1 changed files with 4 additions and 8 deletions
|
@ -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,
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue