From 9bc57a6f598b469fc7bad969a6addb1d4501835c Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:35:15 +1000 Subject: [PATCH] fix(ui): reset initial image when resetting canvas --- .../web/src/features/controlLayers/store/canvasV2Slice.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts b/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts index 28781563fd..77697caf9e 100644 --- a/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts +++ b/invokeai/frontend/web/src/features/controlLayers/store/canvasV2Slice.ts @@ -1,5 +1,5 @@ import type { PayloadAction } from '@reduxjs/toolkit'; -import { createSlice } from '@reduxjs/toolkit'; +import { createAction, createSlice } from '@reduxjs/toolkit'; import type { PersistConfig, RootState } from 'app/store/store'; import { deepClone } from 'common/util/deepClone'; import { bboxReducers } from 'features/controlLayers/store/bboxReducers'; @@ -172,6 +172,7 @@ export const canvasV2Slice = createSlice({ state.session = deepClone(initialState.session); state.tool = deepClone(initialState.tool); state.inpaintMask = deepClone(initialState.inpaintMask); + state.initialImage = deepClone(initialState.initialImage); }, }, }); @@ -386,3 +387,5 @@ export const canvasV2PersistConfig: PersistConfig = { migrate, persistDenylist: [], }; + +export const sessionRequested = createAction(`${canvasV2Slice.name}/sessionRequested`);