mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
BlockOpUpstreamResume: remove cancel - unused?
This commit is contained in:
@@ -26,7 +26,6 @@ export function BlockOpUpstreamResume(props: {
|
||||
upstreamHandle: Exclude<DMessageGenerator['upstreamHandle'], undefined>,
|
||||
pending?: boolean; // true while the message is actively streaming; labels the Delete button as "Stop"
|
||||
onResume?: (mode: AixReattachMode) => void | Promise<void>;
|
||||
onCancel?: () => void | Promise<void>;
|
||||
onDelete?: () => void | Promise<void>;
|
||||
}) {
|
||||
|
||||
@@ -63,18 +62,6 @@ export function BlockOpUpstreamResume(props: {
|
||||
}
|
||||
}, [props]);
|
||||
|
||||
const handleCancel = React.useCallback(async () => {
|
||||
if (!props.onCancel) return;
|
||||
setError(null);
|
||||
setIsCancelling(true);
|
||||
try {
|
||||
await props.onCancel();
|
||||
} catch (err: any) {
|
||||
setError(err?.message || 'Cancel failed');
|
||||
} finally {
|
||||
setIsCancelling(false);
|
||||
}
|
||||
}, [props]);
|
||||
|
||||
// Two-click arm: first click arms (visible red "Confirm?"), second click (within ARM_TIMEOUT_MS) executes.
|
||||
const handleDelete = React.useCallback(async () => {
|
||||
@@ -150,19 +137,6 @@ export function BlockOpUpstreamResume(props: {
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
{props.onCancel && (
|
||||
<Tooltip title='Cancel the response generation'>
|
||||
<Button
|
||||
disabled={inFlightShort}
|
||||
loading={isCancelling}
|
||||
// startDecorator={<CancelIcon />}
|
||||
onClick={handleCancel}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
{props.onDelete && (
|
||||
<Tooltip title={deleteArmed ? 'Click again to confirm - cancels the run upstream (no resume after)' : (props.pending ? 'Stop this response and cancel the upstream run' : 'Cancel the upstream run')}>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user