mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Delay speech preload so web loads faster
This commit is contained in:
parent
2c6c8c0281
commit
c70c4107f6
1 changed files with 7 additions and 3 deletions
|
|
@ -405,10 +405,14 @@ struct WebReaderContainerView: View {
|
|||
anchorIndex: Int(item.readingProgressAnchor),
|
||||
force: false
|
||||
)
|
||||
Task {
|
||||
await audioController.preload(itemIDs: [item.unwrappedID])
|
||||
}
|
||||
viewModel.trackReadEvent(item: item)
|
||||
|
||||
// Wait 1.5s while loading the reader before attempting to preload the speech file
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1500)) {
|
||||
Task {
|
||||
await audioController.preload(itemIDs: [item.unwrappedID])
|
||||
}
|
||||
}
|
||||
}
|
||||
.confirmationDialog(linkToOpen?.absoluteString ?? "", isPresented: $displayLinkSheet,
|
||||
titleVisibility: .visible) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue