Skip to content

Commit

Permalink
fix(topics): remove sheets from topics data
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Sep 15, 2024
1 parent 8a2741b commit 19b2cc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions static/js/sefaria/sefaria.js
Original file line number Diff line number Diff line change
Expand Up @@ -2706,6 +2706,8 @@ _media: {},
const tabs = {};
for (let [linkTypeSlug, linkTypeObj] of Object.entries(data.refs)) {
for (let refObj of linkTypeObj.refs) {
// sheets are no longer displayed on topic pages
if (refObj.is_sheet) { continue; }
let tabKey = linkTypeSlug;
if (tabKey === 'about') {
tabKey = (refObj.descriptions?.[lang]?.title || refObj.descriptions?.[lang]?.prompt) ? 'notable-sources' : 'sources';
Expand All @@ -2724,14 +2726,13 @@ _media: {},
shouldDisplay: linkTypeObj.shouldDisplay,
};
}
const ref = refObj.is_sheet ? parseInt(refObj.ref.replace('Sheet ', '')) : refObj.ref;
if (refObj.order) {
refObj.order = {...refObj.order, availableLangs: refObj?.order?.availableLangs || [],
numDatasource: refObj?.order?.numDatasource || 1,
tfidf: refObj?.order?.tfidf || 0,
pr: refObj?.order?.pr || 0,
curatedPrimacy: {he: refObj?.order?.curatedPrimacy?.he || 0, en: refObj?.order?.curatedPrimacy?.en || 0}}}
tabs[tabKey].refMap[refObj.ref] = {ref, order: refObj.order, dataSources: refObj.dataSources, descriptions: refObj.descriptions};
tabs[tabKey].refMap[refObj.ref] = {ref: refObj.ref, order: refObj.order, dataSources: refObj.dataSources, descriptions: refObj.descriptions};
}
}
for (let tabObj of Object.values(tabs)) {
Expand Down

0 comments on commit 19b2cc8

Please sign in to comment.