From 89a4710493417c4504aff824e7f89a42b7f9a9d0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Oct 2018 22:08:17 +0300 Subject: open lastread location twice. why? i don't even care anymore --- js/read.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/read.js b/js/read.js index d4c2f36..2cf0bb1 100644 --- a/js/read.js +++ b/js/read.js @@ -36,7 +36,13 @@ function open_lastread() { // CFI missing or w/e try { - if (item.cfi) book.rendition.display(item.cfi); + + // this is ridiculous tbh + if (item.cfi) book.rendition.display(item.cfi).then(() => { + book.rendition.display(item.cfi); + }); + + return; } catch (e) { console.warn(e); } @@ -52,7 +58,11 @@ function open_lastread() { try { if (item.cfi != data.cfi && (!item.page || data.page >= item.page)) - book.rendition.display(data.cfi); + console.log('using remote lastread...'); + + book.rendition.display(data.cfi).then(() => { + book.rendition.display(data.cfi); + }); } catch (e) { console.warn(e); } -- cgit v1.2.3