summaryrefslogtreecommitdiff
path: root/js/reader.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/reader.js')
-rw-r--r--js/reader.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/js/reader.js b/js/reader.js
index d1868ac..4540664 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -230,7 +230,7 @@ const Reader = {
Reader.initModals();
Reader.initToc(book);
Reader.initStyleHooks(book);
- Reader.Page.openLastRead(rendition);
+ Reader.Page.openLastRead();
},
showBookInfo: async function(book) {
const bookinfo = await localforage.getItem(Reader.cacheId());
@@ -1312,7 +1312,14 @@ const Reader = {
await window.book.rendition.display(window.book.locations.cfiFromPercentage(0));
}
},
- openLastRead: async function(rendition) {
+ openLastRead: async function() {
+ const rendition = window.book.rendition;
+
+ if (!rendition) {
+ console.error('no rendition to work on');
+ return;
+ }
+
let location_found = false;
const lr_local = await localforage.getItem(Reader.cacheId("lastread")) || {};