1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30

Do not reload channels cache if not needed

This commit is contained in:
Arkadiusz Fal 2023-06-07 21:37:07 +02:00
parent 3bbc2df431
commit f3a8a0977c

View File

@ -68,15 +68,15 @@ final class SubscribedChannelsModel: ObservableObject, CacheModel {
return
}
let request = force ? resource?.load() : resource?.loadIfNeeded()
guard request != nil else { return }
loadCachedChannels(account)
DispatchQueue.main.async { [weak self] in
guard let self else { return }
let request = force ? self.resource?.load() : self.resource?.loadIfNeeded()
if request != nil {
self.isLoading = true
}
request?
.onCompletion { [weak self] _ in