Clear history when loading a new book

This commit is contained in:
Kovid Goyal 2019-10-31 08:58:18 +05:30
parent f1db7eab2f
commit 6e2122df17
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -504,6 +504,7 @@ def on_bridge_ready(self):
def start_book_load(self, initial_cfi=None, initial_toc_node=None, initial_bookpos=None):
key = (set_book_path.path,)
self.clear_history()
self.execute_when_ready('start_book_load', key, initial_cfi, initial_toc_node, initial_bookpos, set_book_path.pathtoebook)
def execute_when_ready(self, action, *args):
@ -568,3 +569,6 @@ def change_background_image(self, img_id):
def goto_frac(self, frac):
self.execute_when_ready('goto_frac', frac)
def clear_history(self):
self._page.history().clear()