Fix cache resources in APIs

This commit is contained in:
Arkadiusz Fal 2022-12-13 22:16:29 +01:00
parent 488b0d2e9b
commit 17b82945b3
2 changed files with 5 additions and 5 deletions

View File

@ -34,6 +34,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
func setAccount(_ account: Account) {
self.account = account
wipeResources()
configure()
if !account.anonymous {
@ -50,11 +51,13 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
return
}
notifications?
feed?
.load()
.onFailure { _ in
self.updateToken(force: true)
}
wipeResources()
}
func configure() {
@ -262,10 +265,6 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
resource(baseURL: account.url, path: basePathAppending("auth/feed"))
}
var notifications: Resource? {
resource(baseURL: account.url, path: basePathAppending("auth/notifications"))
}
var subscriptions: Resource? {
resource(baseURL: account.url, path: basePathAppending("auth/subscriptions"))
}

View File

@ -26,6 +26,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
func setAccount(_ account: Account) {
self.account = account
wipeResources()
configure()
}