Shivam Mishra
2024-10-02 00:36:30 -07:00
committed by GitHub
co-authored by Pranav Sivin Varghese
parent e0bf2bd9d4
commit 42f6621afb
661 changed files with 15939 additions and 31194 deletions
@@ -1,4 +1,3 @@
import Vue from 'vue';
import types from '../mutation-types';
import { REPLY_EDITOR_MODES } from 'dashboard/components/widgets/WootWriter/constants';
@@ -31,16 +30,19 @@ export const actions = {
export const mutations = {
[types.SET_DRAFT_MESSAGES]($state, { key, message }) {
Vue.set($state.records, key, message);
$state.records = {
...$state.records,
[key]: message,
};
LocalStorage.set(LOCAL_STORAGE_KEYS.DRAFT_MESSAGES, $state.records);
},
[types.REMOVE_DRAFT_MESSAGES]($state, { key }) {
const { [key]: draftToBeRemoved, ...updatedRecords } = $state.records;
Vue.set($state, 'records', updatedRecords);
$state.records = updatedRecords;
LocalStorage.set(LOCAL_STORAGE_KEYS.DRAFT_MESSAGES, $state.records);
},
[types.SET_REPLY_EDITOR_MODE]($state, { mode }) {
Vue.set($state, 'replyEditorMode', mode);
$state.replyEditorMode = mode;
},
};