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