summaryrefslogtreecommitdiff
path: root/Hutch/App/AppState.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Hutch/App/AppState.swift')
-rw-r--r--Hutch/App/AppState.swift7
1 files changed, 6 insertions, 1 deletions
diff --git a/Hutch/App/AppState.swift b/Hutch/App/AppState.swift
index ebd25d1..f91f1a4 100644
--- a/Hutch/App/AppState.swift
+++ b/Hutch/App/AppState.swift
@@ -212,6 +212,7 @@ final class AppState {
clearActiveSessionState()
try? KeychainHelper.deleteAll()
URLCache.shared.removeAllCachedResponses()
+ await client.clearPersistentCache()
HTTPCookieStorage.shared.cookies?.forEach { HTTPCookieStorage.shared.deleteCookie($0) }
await clearWebData()
clearWebContentRenderCaches()
@@ -232,6 +233,7 @@ final class AppState {
}
try? KeychainHelper.deleteAll()
URLCache.shared.removeAllCachedResponses()
+ await client.clearPersistentCache()
HTTPCookieStorage.shared.cookies?.forEach { HTTPCookieStorage.shared.deleteCookie($0) }
await clearWebData()
clearWebContentRenderCaches()
@@ -450,7 +452,10 @@ final class AppState {
}
private func makeSession(for account: AccountEntry, knownUser: User? = nil) async throws -> AccountSession {
- let sessionClient = SRHTClient(token: account.token)
+ let sessionClient = SRHTClient(
+ token: account.token,
+ cache: PersistentAPICache(configuration: .accountScoped(accountID: account.id))
+ )
let user: User
if let knownUser {
user = knownUser