Allow hiding "Recently added, "Leaving soon" and "Genres" sections (#658)

This commit is contained in:
redphx
2025-02-03 21:25:38 +07:00
parent fd665b6fcd
commit 7894dea5ff
9 changed files with 76 additions and 11 deletions

View File

@@ -154,9 +154,13 @@ export function clearAllData() {
alert(t('clear-data-success'));
}
export function containsAll(arr: Array<any>, values: Array<any>) {
return values.every(val => arr.includes(val));
}
export function blockAllNotifications() {
const blockFeatures = getGlobalPref(GlobalPref.BLOCK_FEATURES);
const blockAll = [BlockFeature.FRIENDS, BlockFeature.NOTIFICATIONS_ACHIEVEMENTS, BlockFeature.NOTIFICATIONS_INVITES].every(value => blockFeatures.includes(value));
const blockAll = containsAll(blockFeatures, [BlockFeature.FRIENDS, BlockFeature.NOTIFICATIONS_ACHIEVEMENTS, BlockFeature.NOTIFICATIONS_INVITES]);
return blockAll;
}