Hide news by default

This commit is contained in:
Thomas Zarebczan 2022-03-26 15:42:41 -04:00 committed by Thomas Zarebczan
parent 79aa098484
commit 726dc77943

View file

@ -48,6 +48,10 @@ function getInitialList(listId, savedOrder, homepageSections) {
const savedHiddenOrder = savedOrder.hidden || []; const savedHiddenOrder = savedOrder.hidden || [];
const sectionKeys = Object.keys(homepageSections); const sectionKeys = Object.keys(homepageSections);
if (sectionKeys.includes('NEWS') && !savedHiddenOrder.includes('NEWS') && !savedActiveOrder.includes('NEWS')) {
savedHiddenOrder.push('NEWS');
}
if (listId === 'ACTIVE') { if (listId === 'ACTIVE') {
// Start with saved order, excluding obsolete items (i.e. category removed or not available in non-English) // Start with saved order, excluding obsolete items (i.e. category removed or not available in non-English)
const finalOrder = savedActiveOrder.filter((x) => sectionKeys.includes(x)); const finalOrder = savedActiveOrder.filter((x) => sectionKeys.includes(x));