2022-03-17 05:11:27 +01:00
|
|
|
import { createSlice } from '@reduxjs/toolkit'
|
|
|
|
|
|
|
|
const initialState = {
|
2022-03-17 21:26:25 +01:00
|
|
|
idbConnectionReady: false,
|
2022-03-17 05:11:27 +01:00
|
|
|
leftMenuBarOpen: true,
|
|
|
|
leftSidebarWidth: 270
|
|
|
|
};
|
|
|
|
|
|
|
|
export const appSlice = createSlice({
|
|
|
|
name: 'app',
|
|
|
|
initialState,
|
|
|
|
reducers: {
|
|
|
|
toggleLeftMenuBar: (state) => {
|
|
|
|
state.leftMenuBarOpen = !state.leftMenuBarOpen;
|
|
|
|
state.leftSidebarWidth = state.leftMenuBarOpen ? 270 : 222;
|
2022-03-17 21:26:25 +01:00
|
|
|
},
|
|
|
|
idbConnectionReady: (state) => {
|
|
|
|
state.idbConnectionReady = true;
|
2022-03-17 05:11:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-03-17 21:26:25 +01:00
|
|
|
export const { toggleLeftMenuBar, idbConnectionReady } = appSlice.actions;
|
2022-03-17 05:11:27 +01:00
|
|
|
|
|
|
|
export default appSlice.reducer;
|