mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-15 05:44:56 -05:00
Reset canvas session when queue item is canceled in current session
Co-authored-by: kent <kent@invoke.ai>
This commit is contained in:
committed by
psychedelicious
parent
604763d20f
commit
289d8076d8
@@ -9,6 +9,7 @@ import { $queueId } from 'app/store/nanostores/queueId';
|
||||
import type { AppStore } from 'app/store/store';
|
||||
import { deepClone } from 'common/util/deepClone';
|
||||
import { forEach, isNil, round } from 'es-toolkit/compat';
|
||||
import { canvasSessionReset, selectCanvasSessionId } from 'features/controlLayers/store/canvasStagingAreaSlice';
|
||||
import {
|
||||
$isInPublishFlow,
|
||||
$outputNodeId,
|
||||
@@ -347,6 +348,15 @@ export const setEventListeners = ({ socket, store, setIsConnected }: SetEventLis
|
||||
|
||||
log.debug({ data }, `Queue item ${item_id} status updated: ${status}`);
|
||||
|
||||
// If this queue item was canceled and it belongs to the current canvas session, reset the canvas session
|
||||
if (status === 'canceled' && destination) {
|
||||
const currentCanvasSessionId = selectCanvasSessionId(getState());
|
||||
if (currentCanvasSessionId === destination) {
|
||||
dispatch(canvasSessionReset());
|
||||
log.debug(`Canvas session reset due to canceled queue item ${item_id}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Invalidate caches for things we cannot easily update
|
||||
const tagsToInvalidate: ApiTagDescription[] = [
|
||||
'SessionQueueStatus',
|
||||
|
||||
Reference in New Issue
Block a user