feat: Save rich content editor state to user.uiSettings (#1736)

Co-authored-by: Nithin David Thomas <webofnithin@gmail.com>
This commit is contained in:
Pranav Raj S
2021-02-07 12:54:32 +05:30
committed by GitHub
parent 235e4325bc
commit 933661b22c
4 changed files with 92 additions and 27 deletions

View File

@@ -38,6 +38,7 @@ import ChatList from '../../../components/ChatList';
import ContactPanel from './ContactPanel';
import ConversationBox from '../../../components/widgets/conversation/ConversationBox';
import Search from './search/Search.vue';
import uiSettingsMixin from 'dashboard/mixins/uiSettings';
export default {
components: {
@@ -46,6 +47,7 @@ export default {
ConversationBox,
Search,
},
mixins: [uiSettingsMixin],
props: {
inboxId: {
type: [String, Number],
@@ -60,7 +62,6 @@ export default {
default: '',
},
},
data() {
return {
showSearchModal: false,
@@ -68,7 +69,6 @@ export default {
},
computed: {
...mapGetters({
uiSettings: 'getUISettings',
chatList: 'getAllConversations',
currentChat: 'getSelectedChat',
}),
@@ -100,7 +100,6 @@ export default {
this.$store.dispatch('setActiveInbox', this.inboxId);
this.setActiveChat();
},
fetchConversationIfUnavailable() {
if (!this.conversationId) {
return;
@@ -115,7 +114,6 @@ export default {
const [chat] = this.chatList.filter(c => c.id === conversationId);
return chat;
},
setActiveChat() {
if (this.conversationId) {
const chat = this.findConversation();
@@ -130,11 +128,8 @@ export default {
}
},
onToggleContactPanel() {
this.$store.dispatch('updateUISettings', {
uiSettings: {
...this.uiSettings,
is_contact_sidebar_open: !this.isContactPanelOpen,
},
this.updateUISettings({
is_contact_sidebar_open: !this.isContactPanelOpen,
});
},
onSearch() {