diff --git a/Mixonomer/Model/LiveUser.swift b/Mixonomer/Model/LiveUser.swift index a4fc153..c8011ad 100644 --- a/Mixonomer/Model/LiveUser.swift +++ b/Mixonomer/Model/LiveUser.swift @@ -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) -> Bool { return NetworkHelper.check_network_response(response: response, onTokenFail: { self.logout() diff --git a/Mixonomer/Views/LoginScreen.swift b/Mixonomer/Views/LoginScreen.swift index 0bc36c7..bf96260 100644 --- a/Mixonomer/Views/LoginScreen.swift +++ b/Mixonomer/Views/LoginScreen.swift @@ -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))")