From 30a6b73648cc105157b663682df80d51715b18d4 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Thu, 18 Jun 2026 17:27:39 +0200 Subject: [PATCH] Revert "Sort browse migration manga selection by title" e944c6711e4b990d0a87612288623108ff1bd051 Requires preview version of the server --- .../screens/MigrationSelectMangas.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/features/migration/screens/MigrationSelectMangas.tsx b/src/features/migration/screens/MigrationSelectMangas.tsx index e6951689..a918c4ee 100644 --- a/src/features/migration/screens/MigrationSelectMangas.tsx +++ b/src/features/migration/screens/MigrationSelectMangas.tsx @@ -32,7 +32,6 @@ import { Mangas } from '@/features/manga/services/Mangas.ts'; import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts'; import { MigrationContinueButton } from '@/features/migration/components/MigrationContinueButton.tsx'; import { GET_MIGRATABLE_SOURCE_MANGAS } from '@/lib/graphql/manga/MangaQuery.ts'; -import { MangaOrderBy, SortOrder } from '@/lib/graphql/generated/graphql-base.types.ts'; const getSourceError = (error: unknown): unknown => { const message = getErrorMessage(error); @@ -80,23 +79,25 @@ export const MigrationSelectMangas = () => { sourceId, inLibrary: true, }, - order: [ - { - by: MangaOrderBy.Title, - byType: SortOrder.Asc, - }, - { - by: MangaOrderBy.InLibraryAt, - byType: SortOrder.Desc, - }, - ], + // TODO(release) - enable again once minimum server version gets updated + // order: [ + // { + // by: MangaOrderBy.Title, + // byType: SortOrder.Asc, + // }, + // { + // by: MangaOrderBy.InLibraryAt, + // byType: SortOrder.Desc, + // }, + // ], }, { skip: !sourceIds, }, ); - const mangas = migratableSourceMangasData?.mangas.nodes ?? STABLE_EMPTY_ARRAY; + const tmpMangas = migratableSourceMangasData?.mangas.nodes ?? STABLE_EMPTY_ARRAY; + const mangas = useMemo(() => tmpMangas.toSorted((a, b) => a.title.localeCompare(b.title)), [tmpMangas]); const mangaIds = useMemo(() => Mangas.getIds(mangas), [mangas]); const { selectedItemIds, handleSelection, handleSelectAll, areAllItemsSelected, areNoItemsSelected } =