From 70f15404848de97e37e784f29c48360a09957a39 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Jul 2020 09:16:41 +0530 Subject: [PATCH] Fix sync not working for highlights --- src/pyj/read_book/create_annotation.pyj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pyj/read_book/create_annotation.pyj b/src/pyj/read_book/create_annotation.pyj index ff22edfe4d..34502d4285 100644 --- a/src/pyj/read_book/create_annotation.pyj +++ b/src/pyj/read_book/create_annotation.pyj @@ -33,7 +33,7 @@ class AnnotationsManager: newvals = {'highlight': highlights} updated, ans = merge_annotation_maps(base, newvals) if updated: - self.set_highlights(ans) + self.set_highlights(ans.highlight) return updated def remove_highlight(self, uuid): @@ -110,8 +110,7 @@ class AnnotationsManager: def highlights_for_currently_showing(self): name = self.view.currently_showing.name ans = v'[]' - for uuid in Object.keys(self.highlights): - h = self.highlights[uuid] + for h in Object.values(self.highlights): if h.spine_name is name and not h.removed and h.start_cfi: ans.push(h) return ans