apply_highlight() should not leave stale keys in annot_id_uuid_map

This commit is contained in:
Kovid Goyal 2023-09-04 11:58:06 +05:30
parent 1e33d28d3e
commit fa0073ea45
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -832,8 +832,9 @@ class IframeBoss:
removed_highlights = {} removed_highlights = {}
for crw in intersecting_wrappers: for crw in intersecting_wrappers:
unwrap_crw(crw) unwrap_crw(crw)
if annot_id_uuid_map[crw] and annot_id_uuid_map[crw] is not uuid: if annot_id_uuid_map[crw]:
removed_highlights[annot_id_uuid_map[crw]] = True if annot_id_uuid_map[crw] is not uuid:
removed_highlights[annot_id_uuid_map[crw]] = True
v'delete annot_id_uuid_map[crw]' v'delete annot_id_uuid_map[crw]'
removed_highlights = Object.keys(removed_highlights) removed_highlights = Object.keys(removed_highlights)
sel.removeAllRanges() sel.removeAllRanges()