Remove "local source" from source languages filter

The "local source" can't be hidden and therefore should not be shown in the filter
This commit is contained in:
schroda
2026-01-25 03:52:08 +01:00
parent eace67e464
commit bdb9a000f2
3 changed files with 6 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ export function Sources({ tabsMenuHeight }: { tabsMenuHeight: number }) {
() =>
SourceService.filter(sources ?? [], {
showNsfw,
keepLocalSource: false,
removeLocalSource: true,
}),
[sources],
);

View File

@@ -98,12 +98,14 @@ export class Sources {
keepLocalSource,
pinned,
enabled,
removeLocalSource,
}: {
showNsfw?: boolean;
languages?: string[];
keepLocalSource?: boolean;
pinned?: boolean;
enabled?: boolean;
removeLocalSource?: boolean;
} = {},
): Source[] {
const normalizedLanguages = toComparableLanguages(toUniqueLanguageCodes(languages ?? []));
@@ -135,7 +137,8 @@ export class Sources {
!enabled ||
getSourceMetadata(source).isEnabled ||
(keepLocalSource && Sources.isLocalSource(source)),
);
)
.filter((source) => !removeLocalSource || !Sources.isLocalSource(source));
}
static areFromMultipleRepos<Source extends SourceIdInfo & SourceRepoInfo>(sources: Source[]): boolean {