Updates are now checked

This commit is contained in:
2021-12-06 09:55:53 -06:00
parent 451f92b9d6
commit a7a5b98955
4 changed files with 31 additions and 4 deletions

View File

@@ -88,7 +88,7 @@ class W3DHub
return false if !installed?(app_id, channel) || installing?(app_id, channel)
return false unless (game = Store.applications.games.find { |g| g.id == app_id})
return false unless (game = Store.applications.games.find { |g| g.id == app_id })
push_state(
States::ConfirmDialog,
@@ -255,6 +255,25 @@ class W3DHub
@tasks.find { |t| t.is_a?(Installer) && t.app_id == app_id && t.release_channel == channel }
end
def updateable?(app_id, channel)
installed_app = installed?(app_id, channel)
return false unless installed_app
listed_app = Store.applications.games.find { |g| g.id == app_id }
return false unless listed_app
listed_app_channel = listed_app&.channels&.find { |c| c.id == channel }
return false unless listed_app_channel
current_version = Gem::Version.new(installed_app[:installed_version])
listed_version = Gem::Version.new(listed_app_channel.current_version)
listed_version > current_version
end
# No application tasks are being done
def idle?
!busy?