mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
Fix cache resources in APIs
This commit is contained in:
parent
488b0d2e9b
commit
17b82945b3
@ -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"))
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
||||
func setAccount(_ account: Account) {
|
||||
self.account = account
|
||||
|
||||
wipeResources()
|
||||
configure()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user