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 ?? []));
|
||||
|
||||
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 ||
|
||||
|
||||
Reference in New Issue
Block a user