summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-06-09 15:20:17 +0300
committerAndrew Dolgov <[email protected]>2017-06-09 15:20:17 +0300
commitee1f006d6f34959c941fdd164787fbdf42699878 (patch)
treed6c66d77ad71e89a67166aa4c14f2fd7c53ba4d9
parentbbd8f03dfb41595e9b6513a656ca14b68695632f (diff)
on load only open stored CFI when it actually exists
-rw-r--r--read.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/read.html b/read.html
index f1b6827..6cd84a5 100644
--- a/read.html
+++ b/read.html
@@ -600,16 +600,16 @@
localforage.setItem(cacheId("lastread"),
{cfi: data.cfi, page: data.page, total: data.total});
- book.gotoCfi(data.cfi);
+ if (data.cfi) book.gotoCfi(data.cfi);
} else {
localforage.getItem(cacheId("lastread")).then(function(item) {
- if (item) book.gotoCfi(item.cfi);
+ if (item && item.cfi) book.gotoCfi(item.cfi);
});
}
});
} else {
localforage.getItem(cacheId("lastread")).then(function(item) {
- if (item) book.gotoCfi(item.cfi);
+ if (item && item.cfi) book.gotoCfi(item.cfi);
});
}