From dccd49b652d03bf8ec752d24c2da377e551cf829 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Wed, 9 Jun 2021 22:32:02 +0300 Subject: [PATCH] [fix] OPDS catalog invoked from reader: crash KOReader on close (#7825) OPDS catalog can be invoked from reader with gesture. Then on closing OPDS catalog, KOReader crashes. Let's jump to the download folder instead. Closes #7784. --- plugins/opds.koplugin/main.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/opds.koplugin/main.lua b/plugins/opds.koplugin/main.lua index 27144800c..5cf79bed3 100644 --- a/plugins/opds.koplugin/main.lua +++ b/plugins/opds.koplugin/main.lua @@ -23,8 +23,13 @@ function OPDS:showCatalog() local OPDSCatalog = require("opdscatalog") local filemanagerRefresh = function() self.ui:onRefresh() end function OPDSCatalog:onClose() - filemanagerRefresh() UIManager:close(self) + local FileManager = require("apps/filemanager/filemanager") + if FileManager.instance then + filemanagerRefresh() + else + FileManager:showFiles(G_reader_settings:readSetting("download_dir")) + end end OPDSCatalog:showCatalog() end