Fix show_read_book_error not being set

This commit is contained in:
Kovid Goyal 2017-05-09 14:13:41 +05:30
parent 1ceb6af05f
commit c9741c75e2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -128,7 +128,7 @@ class DB:
# https://gist.github.com/nolanlawson/a841ee23436410f37168 # https://gist.github.com/nolanlawson/a841ee23436410f37168
try: try:
req = transaction.objectStore(store).get(data) req = transaction.objectStore(store).get(data)
except Exception: except:
if /Edge\/\d+/.test(window.navigator.userAgent): if /Edge\/\d+/.test(window.navigator.userAgent):
self.show_error(_('Cannot read book'), _( self.show_error(_('Cannot read book'), _(
'Reading of books is not supported on Microsoft Edge. Use a better' 'Reading of books is not supported on Microsoft Edge. Use a better'
@ -342,5 +342,5 @@ class DB:
def get_db(callback, show_read_book_error): def get_db(callback, show_read_book_error):
if not get_db.ans: if not get_db.ans:
get_db.ans = DB(callback) get_db.ans = DB(callback, show_read_book_error)
return get_db.ans return get_db.ans