diff --git a/CHANGELOG.md b/CHANGELOG.md index c0798e46..ed9bd5c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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**) Allow only 2 tracker requests per second - (**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 diff --git a/src/features/migration/screens/MigrationSelectDestinationSources.tsx b/src/features/migration/screens/MigrationSelectDestinationSources.tsx index d4298f42..5024efc7 100644 --- a/src/features/migration/screens/MigrationSelectDestinationSources.tsx +++ b/src/features/migration/screens/MigrationSelectDestinationSources.tsx @@ -49,14 +49,14 @@ export const MigrationSelectDestinationSources = () => { } = requestManager.useGetSourceList(); const allSources = data?.sources.nodes ?? STABLE_EMPTY_ARRAY; - const sources = useMemo( - () => - Sources.filter(allSources, { - languages: browseLanguages, - isNsfw: showNsfw ? undefined : false, - }), - [allSources, browseLanguages, showNsfw], - ); + const sources = useMemo(() => { + const filteredSources = Sources.filter(allSources, { + languages: browseLanguages, + isNsfw: showNsfw ? undefined : false, + }); + + return Object.values(Sources.groupByLanguage(filteredSources)).flat(); + }, [allSources, browseLanguages, showNsfw]); const sourceIds = useMemo(() => Sources.getIds(sources), [sources]); const pinnedSourceIds = useMemo(() => Sources.getIds(Sources.filter(sources, { pinned: true })), [sources]); const enabledSourceIds = useMemo(() => Sources.getIds(Sources.filter(sources, { enabled: true })), [sources]);