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

@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Fixed ### Fixed
- (**Library**) Fix total library size chip color in light mode - (**Library**) Fix total library size chip color in light mode
- (**Browse**) Fix missing pinned sources in the source language filter - (**Browse**) Fix missing pinned sources in the source language filter
- (**Browse**) Fix incorrectly showing "local source" source in the source language filter (the local source can't be disabled)
## [20251230.01] (r2937) - 2025-12-30 ## [20251230.01] (r2937) - 2025-12-30

View File

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

View File

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