Fix missing pinned sources in source language filter

This commit is contained in:
schroda
2026-01-14 23:37:46 +01:00
parent cfc0e672ef
commit 7ef353aa2e
4 changed files with 10 additions and 9 deletions

View File

@@ -9,18 +9,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added ### Added
- (**Theme**) Add an option to save the dynamic color theme on the manga page as a custom theme - (**Theme**) Add an option to save the dynamic color theme on the manga page as a custom theme
### Changed
- (**Theme**) Change "pure black mode" paper background color to true black
### Changed ### Changed
- (**General**) Preserve refresh token (UI Login) over sessions - (**General**) Preserve refresh token (UI Login) over sessions
- (**Theme**) Improve automatic theme background colors - (**Theme**) Improve automatic theme background colors
- (**Theme**) Adjust "primary color" of dynamic color theme on manga pages - (**Theme**) Adjust "primary color" of dynamic color theme on manga pages
- (**Theme**) Increase max length of custom theme names to 32 (previously 16) - (**Theme**) Increase max length of custom theme names to 32 (previously 16)
- (**Theme**) Change "pure black mode" paper background color to true black
- (**Library**) Improve library manga sorting - (**Library**) Improve library manga sorting
### 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
## [20251230.01] (r2937) - 2025-12-30 ## [20251230.01] (r2937) - 2025-12-30

View File

@@ -29,10 +29,9 @@ interface IProps {
languages: string[]; languages: string[];
} }
export function LanguageSelect(props: IProps) { export function LanguageSelect({ selectedLanguages, setSelectedLanguages, languages }: IProps) {
const { t } = useLingui(); const { t } = useLingui();
const { selectedLanguages, setSelectedLanguages, languages } = props;
const [tmpSelectedLanguages, setTmpSelectedLanguages] = useState(toUniqueLanguageCodes(selectedLanguages)); const [tmpSelectedLanguages, setTmpSelectedLanguages] = useState(toUniqueLanguageCodes(selectedLanguages));
const [open, setOpen] = useState<boolean>(false); const [open, setOpen] = useState<boolean>(false);

View File

@@ -58,7 +58,9 @@ export function Sources({ tabsMenuHeight }: { tabsMenuHeight: number }) {
); );
const sourcesByLanguage = useMemo(() => { const sourcesByLanguage = useMemo(() => {
const lastUsedSource = SourceService.getLastUsedSource(lastUsedSourceId, filteredSources); const lastUsedSource = SourceService.getLastUsedSource(lastUsedSourceId, filteredSources);
const groupedByLanguageTuple = Object.entries(SourceService.groupByLanguage(filteredSources)); const groupedByLanguageTuple = Object.entries(
SourceService.groupByLanguage(filteredSources, { withPinnedGroup: true }),
);
if (lastUsedSource) { if (lastUsedSource) {
return [ return [

View File

@@ -52,9 +52,10 @@ export class Sources {
static groupByLanguage<Source extends SourceIdInfo & SourceLanguageInfo & SourceDisplayNameInfo & SourceMetaInfo>( static groupByLanguage<Source extends SourceIdInfo & SourceLanguageInfo & SourceDisplayNameInfo & SourceMetaInfo>(
sources: Source[], sources: Source[],
{ withPinnedGroup = false }: { withPinnedGroup?: boolean } = {},
): Record<string, Source[]> { ): Record<string, Source[]> {
const sourcesByLanguage = Object.groupBy(sources, (source) => { const sourcesByLanguage = Object.groupBy(sources, (source) => {
if (getSourceMetadata(source).isPinned) { if (withPinnedGroup && getSourceMetadata(source).isPinned) {
return DefaultLanguage.PINNED; return DefaultLanguage.PINNED;
} }
@@ -64,11 +65,11 @@ export class Sources {
const isAPinned = a === DefaultLanguage.PINNED; const isAPinned = a === DefaultLanguage.PINNED;
const isBPinned = b === DefaultLanguage.PINNED; const isBPinned = b === DefaultLanguage.PINNED;
if (isAPinned) { if (withPinnedGroup && isAPinned) {
return -1; return -1;
} }
if (isBPinned) { if (withPinnedGroup && isBPinned) {
return 1; return 1;
} }