From e8983d335db8263ba1cf76ccf81b061d17c6f465 Mon Sep 17 00:00:00 2001 From: weijiuqiao Date: Tue, 15 Nov 2022 19:05:31 +0800 Subject: [PATCH] VocabBuilder: fix not updating book title in the more dialogue when the book title is changed but not reassigned. --- plugins/vocabbuilder.koplugin/main.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/vocabbuilder.koplugin/main.lua b/plugins/vocabbuilder.koplugin/main.lua index 947724041..6914dee0e 100644 --- a/plugins/vocabbuilder.koplugin/main.lua +++ b/plugins/vocabbuilder.koplugin/main.lua @@ -1067,13 +1067,14 @@ function VocabItemWidget:onShowBookAssignment(title_changed_cb) return info.name == book end, hold_callback = function(sort_item, onSuccess) + local book_title = self.item.book_title self.show_parent:showChangeBookTitleDialog(sort_item, function() onSuccess() - if self.item.book_title == info.name then - if book == self.item.book_title then + if book_title == info.name then + if book == book_title then book = sort_item.text end - self.item.book_title = sort_item.text + info.name = sort_item.text if title_changed_cb then title_changed_cb(sort_item.text) end end end)