mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
send reading progress updates for ipad grid only
This commit is contained in:
parent
f7f21300f3
commit
b1b3915b7b
2 changed files with 8 additions and 1 deletions
|
|
@ -270,6 +270,9 @@ import Views
|
|||
}
|
||||
}
|
||||
.listStyle(PlainListStyle())
|
||||
.onAppear {
|
||||
viewModel.sendProgressUpdates = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -347,6 +350,9 @@ import Views
|
|||
LoadingSection()
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
viewModel.sendProgressUpdates = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ final class HomeFeedViewModel: ObservableObject {
|
|||
@Published var isLoading = false
|
||||
@Published var showPushNotificationPrimer = false
|
||||
var cursor: String?
|
||||
var sendProgressUpdates = false
|
||||
|
||||
// These are used to make sure we handle search result
|
||||
// responses in the right order
|
||||
|
|
@ -160,7 +161,7 @@ final class HomeFeedViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
func updateProgress(itemID: String, progress: Double) {
|
||||
guard let item = items.first(where: { $0.id == itemID }) else { return }
|
||||
guard sendProgressUpdates, let item = items.first(where: { $0.id == itemID }) else { return }
|
||||
if let index = items.firstIndex(of: item) {
|
||||
items[index].readingProgress = progress
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue