refactor: add more TS constraints
This commit is contained in:
@@ -4,10 +4,6 @@ import { Views } from "../config";
|
||||
export interface State {
|
||||
online: boolean;
|
||||
ready: boolean;
|
||||
userGuide: {
|
||||
visible: boolean;
|
||||
step: number;
|
||||
};
|
||||
inputMode: "text";
|
||||
menuExpand: boolean;
|
||||
// todo
|
||||
@@ -25,10 +21,6 @@ export interface State {
|
||||
const initialState: State = {
|
||||
online: true,
|
||||
ready: false,
|
||||
userGuide: {
|
||||
visible: false,
|
||||
step: 1
|
||||
},
|
||||
inputMode: "text",
|
||||
menuExpand: false,
|
||||
fileListView: Views.grid,
|
||||
@@ -77,12 +69,6 @@ const uiSlice = createSlice({
|
||||
const { key, value } = action.payload;
|
||||
state.draftMixedText[key] = value;
|
||||
},
|
||||
updateUserGuide(state, action) {
|
||||
const obj = action.payload || {};
|
||||
Object.keys(obj).forEach((key) => {
|
||||
state.userGuide[key] = obj[key];
|
||||
});
|
||||
},
|
||||
updateUploadFiles(state, action) {
|
||||
const { context = "channel", id = null, operation = "add", ...rest } = action.payload;
|
||||
if (!id || !context) return;
|
||||
@@ -177,7 +163,6 @@ export const {
|
||||
updateFileListView,
|
||||
updateUploadFiles,
|
||||
updateSelectMessages,
|
||||
updateUserGuide,
|
||||
updateDraftMarkdown,
|
||||
updateDraftMixedText,
|
||||
updateRemeberedNavs
|
||||
|
||||
Reference in New Issue
Block a user