@@ -68,7 +68,7 @@ export const MigrationExecute = () => {
|
||||
})}
|
||||
entries={migratingEntries}
|
||||
isMigrating
|
||||
color="error"
|
||||
color="info"
|
||||
/>
|
||||
<MigrationEntryGroup
|
||||
status={MigrationEntryStatus.MIGRATION_FAILED}
|
||||
|
||||
@@ -71,7 +71,7 @@ export const MigrationSearch = () => {
|
||||
other: '# searching',
|
||||
})}
|
||||
entries={searchingEntries}
|
||||
color="error"
|
||||
color="info"
|
||||
/>
|
||||
<MigrationEntryGroup
|
||||
status={MigrationEntryStatus.SEARCH_FAILED}
|
||||
|
||||
@@ -31,7 +31,7 @@ import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
|
||||
export const MigrationSelectDestinationSources = () => {
|
||||
const { t } = useLingui();
|
||||
const currentSourceId = MigrationManager.useSourceId();
|
||||
const currentSourceIds = MigrationManager.useSourceIds();
|
||||
|
||||
const {
|
||||
settings: { browseLanguages, showNsfw },
|
||||
@@ -156,7 +156,7 @@ export const MigrationSelectDestinationSources = () => {
|
||||
selectedSourceIds={selectedItemIds}
|
||||
handleSelection={handleSelection}
|
||||
handlePriorityChange={handlePriorityChange}
|
||||
currentSourceId={currentSourceId}
|
||||
currentSourceIds={currentSourceIds}
|
||||
/>
|
||||
<Fab
|
||||
variant="extended"
|
||||
|
||||
@@ -26,8 +26,6 @@ import { SelectableCollectionSelectMode } from '@/base/collection/components/Sel
|
||||
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 { AppRoutes } from '@/base/AppRoute.constants.ts';
|
||||
import { ReactRouter } from '@/lib/react-router/ReactRouter.ts';
|
||||
|
||||
const getSourceError = (error: unknown): unknown => {
|
||||
const message = getErrorMessage(error);
|
||||
@@ -45,9 +43,11 @@ const getSourceError = (error: unknown): unknown => {
|
||||
|
||||
export const MigrationSelectMangas = () => {
|
||||
const { t } = useLingui();
|
||||
const sourceId = MigrationManager.useSourceId();
|
||||
const sourceIds = MigrationManager.useSourceIds();
|
||||
const selectedMangas = MigrationManager.useEntries();
|
||||
|
||||
const sourceId = sourceIds?.[0];
|
||||
|
||||
const [gridLayout, setGridLayout] = useLocalStorage('migrateGridLayout', GridLayout.List);
|
||||
|
||||
const {
|
||||
@@ -58,7 +58,7 @@ export const MigrationSelectMangas = () => {
|
||||
} = requestManager.useGetSource<GetSourceMigratableQuery, GetSourceMigratableQueryVariables>(
|
||||
GET_SOURCE_MIGRATABLE,
|
||||
sourceId ?? '',
|
||||
{ skip: !sourceId, notifyOnNetworkStatusChange: true },
|
||||
{ skip: !sourceIds, notifyOnNetworkStatusChange: true },
|
||||
);
|
||||
|
||||
const {
|
||||
@@ -67,7 +67,7 @@ export const MigrationSelectMangas = () => {
|
||||
error: mangasError,
|
||||
refetch: refetchMangas,
|
||||
} = requestManager.useGetMigratableSourceMangas(sourceId!, {
|
||||
skip: !sourceId,
|
||||
skip: !sourceIds,
|
||||
notifyOnNetworkStatusChange: true,
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ export const MigrationSelectMangas = () => {
|
||||
),
|
||||
});
|
||||
|
||||
const sourceName = migratableSourceData?.source?.displayName ?? sourceId ?? t`Migrate`;
|
||||
const sourceName = migratableSourceData?.source?.displayName ?? sourceIds ?? t`Migrate`;
|
||||
useAppTitleAndAction(
|
||||
sourceName,
|
||||
<>
|
||||
@@ -108,22 +108,6 @@ export const MigrationSelectMangas = () => {
|
||||
const handleContinue = () => {
|
||||
const selected = mangas.filter((manga) => selectedItemIds.includes(manga.id));
|
||||
|
||||
const [entry] = selected;
|
||||
const isSingleManga = selected.length === 1;
|
||||
|
||||
if (isSingleManga && entry) {
|
||||
ReactRouter.navigate(
|
||||
AppRoutes.migrate.childRoutes.singleMangaSearch.path(entry.sourceId, entry.id, entry.title),
|
||||
{
|
||||
state: { mangaTitle: entry.title },
|
||||
},
|
||||
);
|
||||
|
||||
MigrationManager.reset();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
MigrationManager.selectMangas(selected);
|
||||
};
|
||||
|
||||
|
||||
@@ -19,11 +19,14 @@ import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { LoadingPlaceholder } from '@/base/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { EmptyViewAbsoluteCentered } from '@/base/components/feedback/EmptyViewAbsoluteCentered.tsx';
|
||||
import type { TMigratableSource } from '@/features/migration/components/MigrationCard.tsx';
|
||||
import { MigrationCard } from '@/features/migration/components/MigrationCard.tsx';
|
||||
import { StyledGroupItemWrapper } from '@/base/components/virtuoso/StyledGroupItemWrapper.tsx';
|
||||
import { defaultPromiseErrorHandler } from '@/lib/DefaultPromiseErrorHandler.ts';
|
||||
import type { SortSettings, TMigratableSourcesResult } from '@/features/migration/Migration.types.ts';
|
||||
import type {
|
||||
SortSettings,
|
||||
TMigratableSource,
|
||||
TMigratableSourcesResult,
|
||||
} from '@/features/migration/Migration.types.ts';
|
||||
import { SortBy, SortOrder } from '@/features/migration/Migration.types.ts';
|
||||
import { sortByToTranslation, sortOrderToTranslation } from '@/features/migration/Migration.constants.ts';
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user