Skip to content

Commit d93f4d9

Browse files
authored
Fix analytics error when contents item selected (#785)
If the contents item doesn't specify a book collection, analytics callback logging history failed with unfilled promise error
1 parent 9bc4a1b commit d93f4d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/routes/contents/[id]/+page.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,12 @@
9191
}
9292
9393
function getReference(item) {
94-
let docSet;
95-
let collection;
94+
let docSet = $refs.docSet;
95+
let collection = docSet.split('_')[1];
9696
let book;
9797
let chapter;
9898
let verse;
9999
const reference = item.linkTarget.split('.');
100-
101100
if (item.layoutMode && item.layoutCollection?.length > 0) {
102101
/*
103102
Note: have not handled layout modes

0 commit comments

Comments
 (0)