react-native-readium 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -13,9 +13,7 @@ We :heart: open source. We work on the things that are important to us when
|
|
|
13
13
|
we're able to work on them. Have an issue you care about?
|
|
14
14
|
|
|
15
15
|
- [Dive Into The Code!](CONTRIBUTING.md)
|
|
16
|
-
- [Sponsor Your Issue](
|
|
17
|
-
|
|
18
|
-
[](https://issuehunt.io/r/5-stones/react-native-readium)
|
|
16
|
+
- [Sponsor Your Issue](#sponsor-the-library)
|
|
19
17
|
|
|
20
18
|
----
|
|
21
19
|
|
|
@@ -201,6 +199,10 @@ yarn version --new-version 1.2.17
|
|
|
201
199
|
yarn version --patch // 1.2.17 -> 1.2.18
|
|
202
200
|
```
|
|
203
201
|
|
|
202
|
+
## Sponsor The Library
|
|
203
|
+
|
|
204
|
+
If you'd like to sponsor a specific feature, fix, or the library in general, please reach out on an issue and we'll have a conversation!
|
|
205
|
+
|
|
204
206
|
## License
|
|
205
207
|
|
|
206
208
|
MIT
|
|
@@ -10,6 +10,9 @@ export const useReaderRef = ({ file, onLocationChange, onTableOfContents, }) =>
|
|
|
10
10
|
}
|
|
11
11
|
if (!newLocation.locations.totalProgression) {
|
|
12
12
|
const newLocationIndex = readingOrder.current.findIndex((entry) => entry.href === newLocation.href);
|
|
13
|
+
if (newLocationIndex < 0 || !readingOrder.current[newLocationIndex]) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
13
16
|
const readingOrderCount = readingOrder.current.length;
|
|
14
17
|
const chapterTotalProgression = readingOrder.current[newLocationIndex].locations?.totalProgression ||
|
|
15
18
|
0;
|
package/package.json
CHANGED
|
@@ -24,6 +24,9 @@ export const useReaderRef = ({
|
|
|
24
24
|
const newLocationIndex = readingOrder.current.findIndex(
|
|
25
25
|
(entry) => entry.href === newLocation.href
|
|
26
26
|
);
|
|
27
|
+
if (newLocationIndex < 0 || !readingOrder.current[newLocationIndex]) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
27
30
|
const readingOrderCount = readingOrder.current.length;
|
|
28
31
|
const chapterTotalProgression =
|
|
29
32
|
readingOrder.current[newLocationIndex].locations?.totalProgression ||
|