From 033412848a3bd03f49bc857b74b22ea9a69874cb Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Sat, 7 Jan 2023 10:36:45 +0000 Subject: [PATCH] adding full refresh on login --- Mixonomer/Model/LiveUser.swift | 10 ++++++++++ Mixonomer/Views/LoginScreen.swift | 2 ++ 2 files changed, 12 insertions(+) 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))")