feat: message draft

This commit is contained in:
zerosoul
2022-05-10 09:35:55 +08:00
parent 1b1cfb956e
commit fe980da31b
6 changed files with 67 additions and 8 deletions
+12
View File
@@ -12,6 +12,8 @@ const initialState = {
fileListView: Views.grid,
uploadFiles: {},
selectMessages: {},
draftMarkdown: {},
draftMixedText: {},
};
const uiSlice = createSlice({
name: "ui",
@@ -35,6 +37,14 @@ const uiSlice = createSlice({
updateFileListView(state, action) {
state.fileListView = action.payload;
},
updateDraftMarkdown(state, action) {
const { key, value } = action.payload;
state.draftMarkdown[key] = value;
},
updateDraftMixedText(state, action) {
const { key, value } = action.payload;
state.draftMixedText[key] = value;
},
updateUserGuide(state, action) {
const obj = action.payload || {};
Object.keys(obj).forEach((key) => {
@@ -146,5 +156,7 @@ export const {
updateUploadFiles,
updateSelectMessages,
updateUserGuide,
updateDraftMarkdown,
updateDraftMixedText,
} = uiSlice.actions;
export default uiSlice.reducer;