mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
30 lines
804 B
TypeScript
30 lines
804 B
TypeScript
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
|
|
|
|
type ModelManagerState = {
|
|
searchFolder: string | null;
|
|
advancedAddScanModel: string | null;
|
|
};
|
|
|
|
const initialModelManagerState: ModelManagerState = {
|
|
searchFolder: null,
|
|
advancedAddScanModel: null,
|
|
};
|
|
|
|
export const modelManagerSlice = createSlice({
|
|
name: 'modelmanager',
|
|
initialState: initialModelManagerState,
|
|
reducers: {
|
|
setSearchFolder: (state, action: PayloadAction<string | null>) => {
|
|
state.searchFolder = action.payload;
|
|
},
|
|
setAdvancedAddScanModel: (state, action: PayloadAction<string | null>) => {
|
|
state.advancedAddScanModel = action.payload;
|
|
},
|
|
},
|
|
});
|
|
|
|
export const { setSearchFolder, setAdvancedAddScanModel } =
|
|
modelManagerSlice.actions;
|
|
|
|
export default modelManagerSlice.reducer;
|