From a0c3cd5ce5e95c55e1d96e289139c8e2550a6e44 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Oct 2018 08:42:13 +0300 Subject: properly handle closing reader UI if current session is invalid --- js/read.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/read.js b/js/read.js index 5739799..a5698ff 100644 --- a/js/read.js +++ b/js/read.js @@ -233,6 +233,9 @@ function save_and_close() { $.post("backend.php", { op: "storelastread", id: $.urlParam("id"), page: currentPage, cfi: currentCfi }, function(data) { window.location = $.urlParam("rt") ? "index.php?mode=" + $.urlParam("rt") : "index.php"; + }) + .fail(function() { + window.location = "index.php"; }); } else { window.location = "index.php"; -- cgit v1.2.3