From 44ad08fc0aab18102033483de8195817d6ddb4da Mon Sep 17 00:00:00 2001 From: Sergio Vera Date: Thu, 9 Jan 2025 12:46:47 +0100 Subject: [PATCH] Fixed reading not being resumed from last position --- internal/webserver/embedded/js/reader.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/webserver/embedded/js/reader.js b/internal/webserver/embedded/js/reader.js index 733a697..2c93c91 100644 --- a/internal/webserver/embedded/js/reader.js +++ b/internal/webserver/embedded/js/reader.js @@ -107,8 +107,11 @@ class Reader { } async open(file) { this.view = document.createElement('foliate-view') + const storage = window.localStorage + const slug = document.getElementById('slug').value document.body.append(this.view) await this.view.open(file) + await this.view.init({lastLocation: storage.getItem(slug)}) this.view.addEventListener('load', this.#onLoad.bind(this)) this.view.addEventListener('relocate', this.#onRelocate.bind(this))