mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 01:02:34 +00:00
Window is no longer a fiber, should prevent window from locking up due to a fiber not yielding, replaced ui's direct async calls with BackgroundWorker.foreground_job, show pulsing circle behind app logo on boot
This commit is contained in:
15
lib/cache.rb
15
lib/cache.rb
@@ -13,17 +13,10 @@ class W3DHub
|
||||
if !force_fetch && File.exist?(path)
|
||||
path
|
||||
else
|
||||
internet = Async::HTTP::Internet.instance
|
||||
|
||||
response = internet.get(uri, W3DHub::Api::DEFAULT_HEADERS)
|
||||
|
||||
if response.success?
|
||||
response.save(path, "wb")
|
||||
|
||||
return path
|
||||
end
|
||||
|
||||
false
|
||||
BackgroundWorker.job(
|
||||
-> { Async::HTTP::Internet.instance.get(uri, W3DHub::Api::DEFAULT_HEADERS) },
|
||||
->(response) { response.save(path, "wb") if response.success? }
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user