Hide action buttons for aborted migration entries
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { MigrationMatch, TMigrationEntry } from '@/features/migration/Migration.types.ts';
|
import type { MigrationMatch, TMigrationEntry } from '@/features/migration/Migration.types.ts';
|
||||||
|
import { MigrationEntryStatus } from '@/features/migration/Migration.types.ts';
|
||||||
import { MigrationManager } from '@/features/migration/MigrationManager.ts';
|
import { MigrationManager } from '@/features/migration/MigrationManager.ts';
|
||||||
import Paper from '@mui/material/Paper';
|
import Paper from '@mui/material/Paper';
|
||||||
import { memo, useLayoutEffect, useMemo, useState } from 'react';
|
import { memo, useLayoutEffect, useMemo, useState } from 'react';
|
||||||
@@ -100,6 +101,7 @@ const MigrationEntryMobile = memo(
|
|||||||
isExcluded={isExcluded}
|
isExcluded={isExcluded}
|
||||||
mangaId={mangaId}
|
mangaId={mangaId}
|
||||||
mangaTitle={mangaTitle}
|
mangaTitle={mangaTitle}
|
||||||
|
isAborted={entry.status === MigrationEntryStatus.SEARCH_ABORTED}
|
||||||
isAbortable={!isAborted && MigrationEntries.isAbortable(entry)}
|
isAbortable={!isAborted && MigrationEntries.isAbortable(entry)}
|
||||||
isMigrating={isMigrating}
|
isMigrating={isMigrating}
|
||||||
/>
|
/>
|
||||||
@@ -164,6 +166,7 @@ export const MigrationEntryDesktop = memo(
|
|||||||
isExcluded={entry.isExcluded}
|
isExcluded={entry.isExcluded}
|
||||||
mangaId={entry.mangaId}
|
mangaId={entry.mangaId}
|
||||||
mangaTitle={entry.mangaTitle}
|
mangaTitle={entry.mangaTitle}
|
||||||
|
isAborted={entry.status === MigrationEntryStatus.SEARCH_ABORTED}
|
||||||
isAbortable={!isAborted && MigrationEntries.isAbortable(entry)}
|
isAbortable={!isAborted && MigrationEntries.isAbortable(entry)}
|
||||||
isMigrating={isMigrating}
|
isMigrating={isMigrating}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
isExcluded,
|
isExcluded,
|
||||||
mangaId,
|
mangaId,
|
||||||
mangaTitle,
|
mangaTitle,
|
||||||
|
isAborted,
|
||||||
isAbortable,
|
isAbortable,
|
||||||
isMigrating,
|
isMigrating,
|
||||||
}: {
|
}: {
|
||||||
@@ -42,6 +43,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
isExcluded: boolean;
|
isExcluded: boolean;
|
||||||
mangaId: MangaIdInfo['id'];
|
mangaId: MangaIdInfo['id'];
|
||||||
mangaTitle: string;
|
mangaTitle: string;
|
||||||
|
isAborted: boolean;
|
||||||
isAbortable: boolean;
|
isAbortable: boolean;
|
||||||
isMigrating: boolean;
|
isMigrating: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
@@ -63,7 +65,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{!isMigrating && !isExpanded && (
|
{!isMigrating && !isExpanded && !isAborted && (
|
||||||
<CustomTooltip title={t`Manual search`}>
|
<CustomTooltip title={t`Manual search`}>
|
||||||
<CustomIconButton
|
<CustomIconButton
|
||||||
sx={{
|
sx={{
|
||||||
@@ -77,7 +79,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
</CustomIconButton>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
{!isMigrating && hasSelectedMatch && (
|
{!isMigrating && hasSelectedMatch && !isAborted && (
|
||||||
<CustomTooltip title={isExcluded ? t`Include` : t`Exclude`}>
|
<CustomTooltip title={isExcluded ? t`Include` : t`Exclude`}>
|
||||||
<CustomIconButton
|
<CustomIconButton
|
||||||
sx={{
|
sx={{
|
||||||
@@ -118,7 +120,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
{!isMigrating && hasSelectedMatch && (
|
{!isMigrating && hasSelectedMatch && !isAborted && (
|
||||||
<CustomTooltip title={isExcluded ? t`Include` : t`Exclude`} placement="auto">
|
<CustomTooltip title={isExcluded ? t`Include` : t`Exclude`} placement="auto">
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
@@ -129,7 +131,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
{!isMigrating && (
|
{!isMigrating && !isAborted && (
|
||||||
<CustomTooltip title={t`Manual search`} placement="auto">
|
<CustomTooltip title={t`Manual search`} placement="auto">
|
||||||
<IconButton
|
<IconButton
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user