feat: remeber file list view

This commit is contained in:
zerosoul
2022-03-31 17:46:07 +08:00
parent 8f2c14436f
commit 6be6dc6458
10 changed files with 205 additions and 34 deletions
+6 -1
View File
@@ -1,5 +1,5 @@
import { createSlice } from "@reduxjs/toolkit";
import { Views } from "../config";
const initialState = {
online: true,
ready: false,
@@ -7,6 +7,7 @@ const initialState = {
menuExpand: false,
setting: false,
channelSetting: null,
fileListView: Views.item,
};
const uiSlice = createSlice({
name: "ui",
@@ -27,6 +28,9 @@ const uiSlice = createSlice({
updateInputMode(state, action) {
state.inputMode = action.payload;
},
updateFileListView(state, action) {
state.fileListView = action.payload;
},
toggleSetting(state) {
state.setting = !state.setting;
},
@@ -45,5 +49,6 @@ export const {
toggleSetting,
toggleMenuExpand,
toggleChannelSetting,
updateFileListView,
} = uiSlice.actions;
export default uiSlice.reducer;