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:
@@ -64,7 +64,13 @@ export class Sources {
|
|||||||
const normalizedLanguages = toComparableLanguages(toUniqueLanguageCodes(languages ?? []));
|
const normalizedLanguages = toComparableLanguages(toUniqueLanguageCodes(languages ?? []));
|
||||||
|
|
||||||
return sources
|
return sources
|
||||||
.filter((source) => showNsfw || !source.isNsfw || (keepLocalSource && Sources.isLocalSource(source)))
|
.filter(
|
||||||
|
(source) =>
|
||||||
|
showNsfw === undefined ||
|
||||||
|
showNsfw ||
|
||||||
|
!source.isNsfw ||
|
||||||
|
(keepLocalSource && Sources.isLocalSource(source)),
|
||||||
|
)
|
||||||
.filter(
|
.filter(
|
||||||
(source) =>
|
(source) =>
|
||||||
!languages ||
|
!languages ||
|
||||||
|
|||||||
Reference in New Issue
Block a user