fix(ui): hide ref panel when last one is deleted

This commit is contained in:
psychedelicious
2025-06-25 17:35:53 +10:00
parent 1aedc26041
commit 242da9e888

View File

@@ -193,6 +193,9 @@ export const refImagesSlice = createSlice({
const nextIndex = clamp(currentIndex, 0, state.entities.length - 1);
const nextEntity = state.entities[nextIndex];
state.selectedEntityId = nextEntity?.id ?? null;
if (state.selectedEntityId === null) {
state.isPanelOpen = false;
}
},
refImageSelected: (state, action: PayloadAction<{ id: string }>) => {
const { id } = action.payload;