feat: message draft
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user