mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
tidy(ui): clean up unused code 4
variables, types and schemas
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import type { RootState } from 'app/store/store';
|
||||
|
||||
export interface QueueState {
|
||||
listCursor: number | undefined;
|
||||
@@ -9,18 +8,16 @@ export interface QueueState {
|
||||
resumeProcessorOnEnqueue: boolean;
|
||||
}
|
||||
|
||||
export const initialQueueState: QueueState = {
|
||||
const initialQueueState: QueueState = {
|
||||
listCursor: undefined,
|
||||
listPriority: undefined,
|
||||
selectedQueueItem: undefined,
|
||||
resumeProcessorOnEnqueue: true,
|
||||
};
|
||||
|
||||
const initialState: QueueState = initialQueueState;
|
||||
|
||||
export const queueSlice = createSlice({
|
||||
name: 'queue',
|
||||
initialState,
|
||||
initialState: initialQueueState,
|
||||
reducers: {
|
||||
listCursorChanged: (state, action: PayloadAction<number | undefined>) => {
|
||||
state.listCursor = action.payload;
|
||||
@@ -32,25 +29,7 @@ export const queueSlice = createSlice({
|
||||
state.listCursor = undefined;
|
||||
state.listPriority = undefined;
|
||||
},
|
||||
queueItemSelectionToggled: (state, action: PayloadAction<string | undefined>) => {
|
||||
if (state.selectedQueueItem === action.payload) {
|
||||
state.selectedQueueItem = undefined;
|
||||
} else {
|
||||
state.selectedQueueItem = action.payload;
|
||||
}
|
||||
},
|
||||
resumeProcessorOnEnqueueChanged: (state, action: PayloadAction<boolean>) => {
|
||||
state.resumeProcessorOnEnqueue = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const {
|
||||
listCursorChanged,
|
||||
listPriorityChanged,
|
||||
listParamsReset,
|
||||
queueItemSelectionToggled,
|
||||
resumeProcessorOnEnqueueChanged,
|
||||
} = queueSlice.actions;
|
||||
|
||||
export const selectQueueSlice = (state: RootState) => state.queue;
|
||||
export const { listCursorChanged, listPriorityChanged, listParamsReset } = queueSlice.actions;
|
||||
|
||||
Reference in New Issue
Block a user