mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #666 from omnivore-app/fix/reader-mode-refresh
Reader mode refresh
This commit is contained in:
commit
4acb0f38f2
1 changed files with 2 additions and 5 deletions
|
|
@ -94,10 +94,7 @@ private let enableGrid = UIDevice.isIPad || FeatureFlag.enableGridCardsOnPhone
|
|||
.navigationTitle("Home")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.onReceive(NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)) { _ in
|
||||
// Don't refresh the list if the user is currently reading an article
|
||||
if viewModel.selectedLinkItem == nil || viewModel.linkRequest == nil {
|
||||
loadItems(isRefresh: true)
|
||||
}
|
||||
loadItems(isRefresh: true)
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: Notification.Name("PushJSONArticle"))) { notification in
|
||||
guard let jsonArticle = notification.userInfo?["article"] as? JSONArticle else { return }
|
||||
|
|
@ -131,7 +128,7 @@ private let enableGrid = UIDevice.isIPad || FeatureFlag.enableGridCardsOnPhone
|
|||
}
|
||||
}
|
||||
}
|
||||
.onAppear { // TODO: use task instead
|
||||
.task {
|
||||
if viewModel.items.isEmpty {
|
||||
loadItems(isRefresh: true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue