Fix source filtering for nsfw

Filtering was always applied even if "showNsfw" was undefined and thus, should not be considered for filtering
This commit is contained in:
schroda
2025-04-24 13:44:30 +02:00
parent d3de9a6db3
commit 394d541746

View File

@@ -64,7 +64,13 @@ export class Sources {
const normalizedLanguages = toComparableLanguages(toUniqueLanguageCodes(languages ?? []));
return sources
.filter((source) => showNsfw || !source.isNsfw || (keepLocalSource && Sources.isLocalSource(source)))
.filter(
(source) =>
showNsfw === undefined ||
showNsfw ||
!source.isNsfw ||
(keepLocalSource && Sources.isLocalSource(source)),
)
.filter(
(source) =>
!languages ||