Skip to content

Commit

Permalink
fix: remove error when annotations are null (#454)
Browse files Browse the repository at this point in the history
Co-authored-by: malkja <[email protected]>
  • Loading branch information
orlinmalkja and malkja authored Jul 17, 2024
1 parent 5dd3db1 commit 0d3c566
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stores/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ export const useAnnotationsStore = defineStore('annotations', () => {
};


const addHighlightAttributesToText = (dom) => {
const addHighlightAttributesToText = (dom) => {
if (annotations.value !== null) {
annotations.value.forEach((annotation) => {
const { id } = annotation;
const selector = Utils.generateTargetSelector(annotation);
if (selector) {
Utils.addHighlightToElements(selector, dom, id);
}
});
}
};

const annotationLoaded = (annotations) => {
Expand Down

0 comments on commit 0d3c566

Please sign in to comment.