mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): migrate to redux-remember
This commit is contained in:
@ -6,15 +6,13 @@ type HotkeysState = {
|
||||
shift: boolean;
|
||||
};
|
||||
|
||||
const initialHotkeysState: HotkeysState = {
|
||||
export const initialHotkeysState: HotkeysState = {
|
||||
shift: false,
|
||||
};
|
||||
|
||||
const initialState: HotkeysState = initialHotkeysState;
|
||||
|
||||
export const hotkeysSlice = createSlice({
|
||||
name: 'hotkeys',
|
||||
initialState,
|
||||
initialState: initialHotkeysState,
|
||||
reducers: {
|
||||
shiftKeyPressed: (state, action: PayloadAction<boolean>) => {
|
||||
state.shift = action.payload;
|
||||
|
@ -4,6 +4,9 @@ import { UIState } from './uiTypes';
|
||||
* UI slice persist denylist
|
||||
*/
|
||||
const itemsToDenylist: (keyof UIState)[] = ['floatingProgressImageRect'];
|
||||
export const uiPersistDenylist: (keyof UIState)[] = [
|
||||
'floatingProgressImageRect',
|
||||
];
|
||||
|
||||
export const uiDenylist = itemsToDenylist.map(
|
||||
(denylistItem) => `ui.${denylistItem}`
|
||||
|
@ -4,7 +4,7 @@ import { setActiveTabReducer } from './extraReducers';
|
||||
import { InvokeTabName, tabMap } from './tabMap';
|
||||
import { AddNewModelType, Coordinates, Rect, UIState } from './uiTypes';
|
||||
|
||||
const initialUIState: UIState = {
|
||||
export const initialUIState: UIState = {
|
||||
activeTab: 0,
|
||||
currentTheme: 'dark',
|
||||
parametersPanelScrollPosition: 0,
|
||||
@ -26,11 +26,9 @@ const initialUIState: UIState = {
|
||||
shouldAutoShowProgressImages: false,
|
||||
};
|
||||
|
||||
const initialState: UIState = initialUIState;
|
||||
|
||||
export const uiSlice = createSlice({
|
||||
name: 'ui',
|
||||
initialState,
|
||||
initialState: initialUIState,
|
||||
reducers: {
|
||||
setActiveTab: (state, action: PayloadAction<number | InvokeTabName>) => {
|
||||
setActiveTabReducer(state, action.payload);
|
||||
|
Reference in New Issue
Block a user