[gnome-documents] epubview: Don't blindly advertise the presence of pages



commit 07cf26fec6674fb65d57fa1003b5b90f43cde2cf
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 1 14:23:59 2017 +0200

    epubview: Don't blindly advertise the presence of pages
    
    Preview.hasPages should only be true when the document has finished
    loading and is known to have a non-zero number of pages. Otherwise, it
    will show an empty EPUBBarWidget while loading the document.
    
    This brings it in line with the EvinceView implementation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782685

 src/epubview.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/epubview.js b/src/epubview.js
index 28a0023..baeb64e 100644
--- a/src/epubview.js
+++ b/src/epubview.js
@@ -145,7 +145,7 @@ const EPUBView = new Lang.Class({
     },
 
     get hasPages() {
-        return true;
+        return this._epubdoc ? this._epubdoc.get_n_pages() > 0 : false;
     },
 
     get page() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]