mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-15 16:52:34 +00:00
Refresh token at start up now works, added a bit of a hack to populate account info by opening the login page first and having it populate the data then load the games page, added Cache, and Settings
This commit is contained in:
@@ -44,7 +44,7 @@ class W3DHub
|
||||
if @progressbar.value >= 1.0 && @task_index == @tasks.size
|
||||
push_state(
|
||||
States::Interface,
|
||||
refresh_token: @refresh_token,
|
||||
account: @account,
|
||||
service_status: @service_status,
|
||||
applications: @applications
|
||||
)
|
||||
@@ -61,9 +61,23 @@ class W3DHub
|
||||
end
|
||||
|
||||
def refresh_user_token
|
||||
@tasks[:refresh_user_token][:complete] = true
|
||||
if window.settings[:account, :refresh_token]
|
||||
Thread.new do
|
||||
@account = Api.refresh_user_login(window.settings[:account, :refresh_token])
|
||||
|
||||
@refresh_token = nil
|
||||
if @account
|
||||
window.settings[:account][:refresh_token] = @account.refresh_token
|
||||
window.settings.save_settings
|
||||
else
|
||||
window.settings[:account][:refresh_token] = nil
|
||||
window.settings.save_settings
|
||||
end
|
||||
|
||||
@tasks[:refresh_user_token][:complete] = true
|
||||
end
|
||||
else
|
||||
@tasks[:refresh_user_token][:complete] = true
|
||||
end
|
||||
end
|
||||
|
||||
def service_status
|
||||
|
||||
Reference in New Issue
Block a user