Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

[Pre-release fix] wrap linklist generation in condition to prevent script blocking error #929

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions express/scripts/ckg-link-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,24 +254,26 @@ async function lazyLoadSearchMarqueeLinklist() {

if (searchMarquee) {
const linkListContainer = searchMarquee.querySelector('.carousel-container > .carousel-platform');
const linkListTemplate = linkListContainer.querySelector('p').cloneNode(true);
if (linkListContainer) {
const linkListTemplate = linkListContainer.querySelector('p').cloneNode(true);

const linkListData = [];
const linkListData = [];

if (window.linkLists && window.linkLists.ckgData && getMetadata('short-title')) {
window.linkLists.ckgData.forEach((row) => {
linkListData.push({
childSibling: row['child-siblings'],
ckgID: row.ckgID,
shortTitle: getMetadata('short-title'),
tasks: row.parent, // task on the page
displayValue: row.displayValue,
if (window.linkLists && window.linkLists.ckgData && getMetadata('short-title')) {
window.linkLists.ckgData.forEach((row) => {
linkListData.push({
childSibling: row['child-siblings'],
ckgID: row.ckgID,
shortTitle: getMetadata('short-title'),
tasks: row.parent, // task on the page
displayValue: row.displayValue,
});
});
});
}
}

await updateLinkList(linkListContainer, linkListTemplate, linkListData);
linkListContainer.parentElement.classList.add('appear');
await updateLinkList(linkListContainer, linkListTemplate, linkListData);
linkListContainer.parentElement.classList.add('appear');
}
}
}

Expand Down