mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Refactored API to support both backends and to re-enable logging in (on the primary backend)
This commit is contained in:
@@ -111,7 +111,7 @@ class W3DHub
|
||||
return unless news
|
||||
|
||||
news.items[0..15].each do |item|
|
||||
Cache.fetch(uri: item.image, async: false)
|
||||
Cache.fetch(uri: item.image, async: false, backend: :w3dhub)
|
||||
end
|
||||
|
||||
@w3dhub_news = news
|
||||
|
||||
@@ -425,7 +425,7 @@ class W3DHub
|
||||
return false unless news
|
||||
|
||||
news.items[0..15].each do |item|
|
||||
Cache.fetch(uri: item.image, async: false)
|
||||
Cache.fetch(uri: item.image, async: false, backend: :w3dhub)
|
||||
end
|
||||
|
||||
@game_news[game.id] = news
|
||||
|
||||
@@ -44,8 +44,10 @@ class W3DHub
|
||||
Store.settings[:account][:data] = account
|
||||
Store.settings.save_settings
|
||||
|
||||
Cache.fetch(uri: account.avatar_uri, force_fetch: true, async: false) if account
|
||||
applications = Api.applications if account
|
||||
if account
|
||||
Cache.fetch(uri: account.avatar_uri, force_fetch: true, async: false, backend: :w3dhub)
|
||||
applications = Api._applications
|
||||
end
|
||||
end
|
||||
|
||||
[account, applications]
|
||||
@@ -79,7 +81,7 @@ class W3DHub
|
||||
|
||||
if Store.account
|
||||
BackgroundWorker.foreground_job(
|
||||
-> { Cache.fetch(uri: Store.account.avatar_uri, async: false) },
|
||||
-> { Cache.fetch(uri: Store.account.avatar_uri, async: false, backend: :w3dhub) },
|
||||
->(result) {
|
||||
populate_account_info
|
||||
page(W3DHub::Pages::Games)
|
||||
@@ -152,7 +154,7 @@ class W3DHub
|
||||
Store.account = nil
|
||||
|
||||
BackgroundWorker.foreground_job(
|
||||
-> { Api.applications },
|
||||
-> { Api._applications },
|
||||
lambda do |applications|
|
||||
if applications
|
||||
Store.applications = applications
|
||||
|
||||
Reference in New Issue
Block a user