diff options
Diffstat (limited to 'js/reader.js')
-rw-r--r-- | js/reader.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/js/reader.js b/js/reader.js index 682578a..12e19d0 100644 --- a/js/reader.js +++ b/js/reader.js @@ -1345,6 +1345,8 @@ const Reader = { const lr_local = await localforage.getItem(Reader.cacheId("lastread")) || {}; + console.log('got local lastread', lr_local); + if (lr_local && lr_local.cfi) { console.log('using local lastread cfi', lr_local.cfi); try { @@ -1362,7 +1364,7 @@ const Reader = { console.log('got remote lastread', lr_remote); if (lr_remote) { - if (lr_remote.cfi && lr_local.cfi != lr_remote.cfi && (!lr_local.timestamp || lr_remote.timestamp <= lr_local.timestamp)) { + if (lr_remote.cfi && lr_local.cfi != lr_remote.cfi && (lr_remote.timestamp >= (lr_local.timestamp || 0))) { console.log(`using remote lastread cfi ${lr_remote.cfi} (timestamp is newer or local timestamp is missing)`); await localforage.setItem(Reader.cacheId("lastread"), |