From e0fa6230ab6571181e1f90dbcbf55e2ed074bc28 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 3 May 2026 22:31:02 +0800 Subject: [PATCH] feat(koplugin): support deletePluginSettings hook (#4045) Implements the hook introduced by koreader/koreader#15240, called when the user deletes the plugin via the plugin manager with "Also delete plugin settings" checked. Removes the readest_sync entry from G_reader_settings (auth tokens, user info, auto_sync flag, last_sync_at) and resets the in-memory copy to defaults. Closes #4039 Co-authored-by: Claude Opus 4.7 (1M context) --- apps/readest.koplugin/main.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/readest.koplugin/main.lua b/apps/readest.koplugin/main.lua index 0dac4f5e..85d26189 100644 --- a/apps/readest.koplugin/main.lua +++ b/apps/readest.koplugin/main.lua @@ -381,4 +381,10 @@ function ReadestSync:onCloseWidget() end end +function ReadestSync:deletePluginSettings() + G_reader_settings:delSetting("readest_sync") + self.settings = self.default_settings + return true +end + return ReadestSync