From 1875c4ee7357c8e5b3b42dd357e856f26791a596 Mon Sep 17 00:00:00 2001 From: Aabed Khan <39409020+TheAabedKhan@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:44:53 +0545 Subject: [PATCH] fix: update button being clickable when offline (#987) --- lib/ui/views/home/home_viewmodel.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index b05f0e4da4..972a13c144 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -112,13 +112,14 @@ class HomeViewModel extends BaseViewModel { Future hasManagerUpdates() async { String currentVersion = await _managerAPI.getCurrentManagerVersion(); - _latestManagerVersion = await _managerAPI.getLatestManagerVersion(); - + // add v to current version if (!currentVersion.startsWith('v')) { currentVersion = 'v$currentVersion'; } - + + _latestManagerVersion = await _managerAPI.getLatestManagerVersion() ?? currentVersion; + if (_latestManagerVersion != currentVersion) { return true; }