refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-08 10:18:23 +08:00
parent be6822e568
commit 678b8515ca
36 changed files with 210 additions and 220 deletions
+6 -3
View File
@@ -39,7 +39,7 @@ const uiSlice = createSlice({
name: "ui",
initialState,
reducers: {
fullfillUI(state, action) {
fillUI(state, action) {
return { ...initialState, ...action.payload };
},
setReady(state) {
@@ -57,7 +57,10 @@ const uiSlice = createSlice({
updateFileListView(state, action) {
state.fileListView = action.payload;
},
updateRememberedNavs(state, action: PayloadAction<{ key?: string; path: string | null }>) {
updateRememberedNavs(
state,
action: PayloadAction<{ key?: "chat" | "user"; path: string | null } | undefined>
) {
const { key = "chat", path = null } = action.payload || {};
state.rememberedNavs[key] = path;
},
@@ -155,7 +158,7 @@ const uiSlice = createSlice({
});
export const {
fullfillUI,
fillUI,
setReady,
updateOnline,
updateInputMode,