feat(ui): migrate to redux-remember

This commit is contained in:
psychedelicious
2023-05-06 00:28:00 +10:00
parent bcc21531fb
commit 09f166577e
47 changed files with 379 additions and 313 deletions

View File

@ -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;

View File

@ -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}`

View File

@ -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);