diff options
Diffstat (limited to 'js/reader.js')
-rw-r--r-- | js/reader.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/js/reader.js b/js/reader.js index 71e783a..aa05703 100644 --- a/js/reader.js +++ b/js/reader.js @@ -481,10 +481,18 @@ const Reader = { return localforage.getItem(Reader.cacheId()).then((bookinfo) => { - console.log('bookinfo', bookinfo, Reader.cacheId()); + let title; + let author; - const title = bookinfo.title; - const author = bookinfo.author_sort; + if (bookinfo) { + title = bookinfo.title; + author = bookinfo.author_sort; + } else { + const metadata = book.package.metadata; + + title = metadata.title; + author = metadata.creator; + } document.title = title + " – " + author + " – The Epube"; $(".title") |