From fa0073ea4537815ed33a61d98750e9e34984740d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 4 Sep 2023 11:58:06 +0530 Subject: [PATCH] apply_highlight() should not leave stale keys in annot_id_uuid_map --- src/pyj/read_book/iframe.pyj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pyj/read_book/iframe.pyj b/src/pyj/read_book/iframe.pyj index 1fffd8340f..7d2ad82074 100644 --- a/src/pyj/read_book/iframe.pyj +++ b/src/pyj/read_book/iframe.pyj @@ -832,8 +832,9 @@ class IframeBoss: removed_highlights = {} for crw in intersecting_wrappers: unwrap_crw(crw) - if annot_id_uuid_map[crw] and annot_id_uuid_map[crw] is not uuid: - removed_highlights[annot_id_uuid_map[crw]] = True + if annot_id_uuid_map[crw]: + if annot_id_uuid_map[crw] is not uuid: + removed_highlights[annot_id_uuid_map[crw]] = True v'delete annot_id_uuid_map[crw]' removed_highlights = Object.keys(removed_highlights) sel.removeAllRanges()