Fix reloading account token

This commit is contained in:
Arkadiusz Fal 2022-08-31 22:00:24 +02:00
parent c24b561c13
commit dfe3fb81ea
2 changed files with 4 additions and 1 deletions

View File

@ -226,10 +226,12 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
print("updating invidious token") print("updating invidious token")
let sid = String(cookies[substringRange]) let sid = String(cookies[substringRange])
AccountsModel.setToken(self.account, sid) AccountsModel.setToken(self.account, sid)
self.configure() self.objectWillChange.send()
} else { } else {
presentTokenUpdateFailedAlert(nil, "Could not extract SID from received cookies: \(cookies)") presentTokenUpdateFailedAlert(nil, "Could not extract SID from received cookies: \(cookies)")
} }
self.configure()
} }
} }

View File

@ -131,6 +131,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
) )
} else if !token.isEmpty { } else if !token.isEmpty {
AccountsModel.setToken(self.account, token) AccountsModel.setToken(self.account, token)
self.objectWillChange.send()
} else { } else {
NavigationModel.shared.presentAlert( NavigationModel.shared.presentAlert(
title: "Account Error", title: "Account Error",