diff options
Diffstat (limited to 'js/index.js')
-rw-r--r-- | js/index.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/index.js b/js/index.js index 2ec26f3..c5e2748 100644 --- a/js/index.js +++ b/js/index.js @@ -207,9 +207,18 @@ function offline_get_all() { var dropitem = $(row).find(".offline_dropitem")[0]; if (bookId) { - offline_cache(bookId, function() { - mark_offline(dropitem); + + var cacheId = 'epube-book.' + bookId; + localforage.getItem(cacheId).then(function(book) { + + if (!book) { + offline_cache(bookId, function() { + mark_offline(dropitem); + }); + } + }); + } }); } |