diff options
author | Andrew Dolgov <[email protected]> | 2017-06-09 15:20:17 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-06-09 15:20:17 +0300 |
commit | ee1f006d6f34959c941fdd164787fbdf42699878 (patch) | |
tree | d6c66d77ad71e89a67166aa4c14f2fd7c53ba4d9 /read.html | |
parent | bbd8f03dfb41595e9b6513a656ca14b68695632f (diff) |
on load only open stored CFI when it actually exists
Diffstat (limited to 'read.html')
-rw-r--r-- | read.html | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); }); } |