Skip to content

Commit 37c4e5d

Browse files
authored
Merge pull request #588 from subugoe/fix-annotations
fix: display annotations when no refs are given
2 parents 9ae7534 + 91613d8 commit 37c4e5d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/stores/annotations.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export const useAnnotationsStore = defineStore('annotations', () => {
197197
}
198198
};
199199

200-
const annotationLoaded = ({ items, refs }) => {
200+
const annotationLoaded = ({ items = [], refs = [] }) => {
201201
annotations.value = items
202202
witnesses.value = refs
203203

@@ -316,12 +316,13 @@ export const useAnnotationsStore = defineStore('annotations', () => {
316316
return;
317317
}
318318

319-
const current = await request(annotations.first);
319+
const page = await request(annotations.first);
320320

321-
if (Array.isArray(current.items)) {
322-
annotationLoaded(current)
321+
if (Array.isArray(page.items)) {
322+
annotationLoaded(page)
323323
}
324324
} catch (err) {
325+
console.error(err)
325326
annotationLoaded({ items: [], refs: [] })
326327
}
327328
};

0 commit comments

Comments
 (0)