fix: update button being clickable when offline (#987)

This commit is contained in:
Aabed Khan 2023-07-05 18:44:53 +05:45 committed by GitHub
parent 76c68baa1f
commit 1875c4ee73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,13 +112,14 @@ class HomeViewModel extends BaseViewModel {
Future<bool> hasManagerUpdates() async { Future<bool> hasManagerUpdates() async {
String currentVersion = await _managerAPI.getCurrentManagerVersion(); String currentVersion = await _managerAPI.getCurrentManagerVersion();
_latestManagerVersion = await _managerAPI.getLatestManagerVersion();
// add v to current version // add v to current version
if (!currentVersion.startsWith('v')) { if (!currentVersion.startsWith('v')) {
currentVersion = 'v$currentVersion'; currentVersion = 'v$currentVersion';
} }
_latestManagerVersion = await _managerAPI.getLatestManagerVersion() ?? currentVersion;
if (_latestManagerVersion != currentVersion) { if (_latestManagerVersion != currentVersion) {
return true; return true;
} }