adding full refresh on login

This commit is contained in:
Andy Pack 2023-01-07 10:36:45 +00:00
parent 17a7600a9d
commit 033412848a
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
2 changed files with 12 additions and 0 deletions

View File

@ -249,6 +249,16 @@ class LiveUser: ObservableObject {
}
}
func full_refresh() {
self.isInitiallyRefreshingUser = true
self.isInitiallyRefreshingPlaylists = true
self.isInitiallyRefreshingTags = true
self.refresh_user()
self.refresh_playlists()
self.refresh_tags()
}
func check_network_response(response: AFDataResponse<Any>) -> Bool {
return NetworkHelper.check_network_response(response: response, onTokenFail: {
self.logout()

View File

@ -109,6 +109,8 @@ struct LoginScreen: View {
let token = json["token"].stringValue
keychain["jwt"] = token
self.liveUser.full_refresh()
self.liveUser.loggedIn = true
Logger.net.info("login succeeded (\(code))")