Sort sources in migration destination source selection page
This commit is contained in:
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
- (**Migration**) Prevent concurrent requests to the same tracker
|
- (**Migration**) Prevent concurrent requests to the same tracker
|
||||||
- (**Migration**) Allow only 2 tracker requests per second
|
- (**Migration**) Allow only 2 tracker requests per second
|
||||||
- (**Migration**) Sort manga to migrate selection by title and by recently added to the library
|
- (**Migration**) Sort manga to migrate selection by title and by recently added to the library
|
||||||
|
- (**Migration**) Sort destination source selection by same order as browse source page
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -49,14 +49,14 @@ export const MigrationSelectDestinationSources = () => {
|
|||||||
} = requestManager.useGetSourceList();
|
} = requestManager.useGetSourceList();
|
||||||
|
|
||||||
const allSources = data?.sources.nodes ?? STABLE_EMPTY_ARRAY;
|
const allSources = data?.sources.nodes ?? STABLE_EMPTY_ARRAY;
|
||||||
const sources = useMemo(
|
const sources = useMemo(() => {
|
||||||
() =>
|
const filteredSources = Sources.filter(allSources, {
|
||||||
Sources.filter(allSources, {
|
|
||||||
languages: browseLanguages,
|
languages: browseLanguages,
|
||||||
isNsfw: showNsfw ? undefined : false,
|
isNsfw: showNsfw ? undefined : false,
|
||||||
}),
|
});
|
||||||
[allSources, browseLanguages, showNsfw],
|
|
||||||
);
|
return Object.values(Sources.groupByLanguage(filteredSources)).flat();
|
||||||
|
}, [allSources, browseLanguages, showNsfw]);
|
||||||
const sourceIds = useMemo(() => Sources.getIds(sources), [sources]);
|
const sourceIds = useMemo(() => Sources.getIds(sources), [sources]);
|
||||||
const pinnedSourceIds = useMemo(() => Sources.getIds(Sources.filter(sources, { pinned: true })), [sources]);
|
const pinnedSourceIds = useMemo(() => Sources.getIds(Sources.filter(sources, { pinned: true })), [sources]);
|
||||||
const enabledSourceIds = useMemo(() => Sources.getIds(Sources.filter(sources, { enabled: true })), [sources]);
|
const enabledSourceIds = useMemo(() => Sources.getIds(Sources.filter(sources, { enabled: true })), [sources]);
|
||||||
|
|||||||
Reference in New Issue
Block a user