feat: allow inbox specific flags for signature toggle (#8280)

Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
This commit is contained in:
Shivam Mishra
2023-11-08 10:47:22 +05:30
committed by GitHub
parent 4cb981d81b
commit 5d224f2e04
5 changed files with 34 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
import { mapGetters } from 'vuex';
export const DEFAULT_CONVERSATION_SIDEBAR_ITEMS_ORDER = [
{ name: 'conversation_actions' },
{ name: 'macros' },
@@ -13,6 +14,9 @@ export const DEFAULT_CONTACT_SIDEBAR_ITEMS_ORDER = [
{ name: 'previous_conversation' },
];
const slugifyChannel = name =>
name.toLowerCase().replace(' ', '_').replace('-', '_').replace('::', '_');
export const isEditorHotKeyEnabled = (uiSettings, key) => {
const {
editor_message_key: editorMessageKey,
@@ -65,5 +69,17 @@ export default {
toggleSidebarUIState(key) {
this.updateUISettings({ [key]: !this.isContactSidebarItemOpen(key) });
},
setSignatureFlagForInbox(channelType, value) {
channelType = slugifyChannel(channelType);
this.updateUISettings({
[`${channelType}_signature_enabled`]: value,
});
},
fetchSignatureFlagFromUiSettings(channelType) {
if (!channelType) return false;
channelType = slugifyChannel(channelType);
return this.uiSettings[`${channelType}_signature_enabled`];
},
},
};