Open mattdvhope opened 3 weeks ago
Any update on this? I'm experiencing the same thing
@araycollado I had this and applying the fix in #286 actually fixed it — it sounds like OP already tried that, but if you haven’t, it would be worth giving it a try.
(I’d rather have a more robust fix though as then I could load the book faster without waiting for onLocationsReady.)
@forjoyilive Just tried that solution again and it does work. Might have confused it with another issue. I appreciate the help!
Summary
When I restart my app,
goToLocation
fires properly, enabling me to go to the locally stored cfi location. But, inPagination
, as I swipe to the next/previous page within a single chapter, my current cfi remains unchanged. Only after I transition to another section/chapter does the actual cfi of the current page start to be made available again. Thereafter, each page-swipe givesgetCurrentLocation()
a fresh cfi.If the reader never transitions to another chapter during one reading session, when he opens the app again, he will revert to the previously stored cfi. Only when he transitions to a new chapter will a fresh cfi be provided (for
getCurrentLocation()
) with each new page-swipe.I did notice that as soon as I restart my app, if I very quickly swipe to another page or two within the chapter after loading, the correct CFI of the next page (or two) will be provided for
getCurrentLocation()
. But then this "shuts down" after a very short time-window (about 2-3 seconds). My "current cfi" then stays stuck (as I page-swipe within the current chapter) until I swipe into the next/previous chapter.I looked at https://github.com/victorsoares96/epubjs-react-native/issues/286 which does have some similarities to my situation. But in my case, it seems that the only thing that will "trigger"
getCurrentLocation()
getting a new cfi is transitioning to a new chapter after app-restart.What platform(s) does this occur on?
Android
What workflow(s) does this occur on?
Expo Workflow
Environment (or package.json)
expo-env-info 1.2.0 environment info: System: OS: macOS 14.6.1 Shell: 3.2.57 - /bin/bash Binaries: Node: 22.9.0 - /usr/local/bin/node Yarn: 1.22.22 - /usr/local/bin/yarn npm: 10.8.3 - /usr/local/bin/npm Watchman: 2024.11.04.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.15.2 - /Users/matthewmalone/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 24.1, iOS 18.1, macOS 15.1, tvOS 18.1, visionOS 2.1, watchOS 11.1 IDEs: Android Studio: 2024.2 AI-242.23339.11.2421.12483815 Xcode: 16.1/16B40 - /usr/bin/xcodebuild npmPackages: expo: ~51.0.28 => 51.0.38 expo-router: ^3.5.23 => 3.5.23 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.74.5 => 0.74.5 react-native-web: ~0.19.10 => 0.19.13 npmGlobalPackages: eas-cli: 12.6.2 expo-cli: 6.3.12 Expo Workflow: managed
Your .epub file
No response
Minimal reproducible example
I confirm that i have