feat: Configure Chatwoot & Analytics for SaaS app (#2975)
* feat: Add Chatwoot support inside Chatwoot SaaS * Fix identity issues with Chatwoot
This commit is contained in:
parent
8de4ce0037
commit
4759730022
12 changed files with 125 additions and 39 deletions
|
@ -255,19 +255,11 @@ export default {
|
|||
return frontendURL(`accounts/${this.accountId}/dashboard`);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
currentUser(newUserInfo, oldUserInfo) {
|
||||
if (!oldUserInfo.email && newUserInfo.email) {
|
||||
this.setChatwootUser();
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch('labels/get');
|
||||
this.$store.dispatch('inboxes/get');
|
||||
this.$store.dispatch('notifications/unReadCount');
|
||||
this.$store.dispatch('teams/get');
|
||||
this.setChatwootUser();
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -288,17 +280,6 @@ export default {
|
|||
toggleSupportChatWindow() {
|
||||
window.$chatwoot.toggle();
|
||||
},
|
||||
setChatwootUser() {
|
||||
if (!this.currentUser.email || !this.globalConfig.chatwootInboxToken) {
|
||||
return;
|
||||
}
|
||||
window.$chatwoot.setUser(this.currentUser.email, {
|
||||
name: this.currentUser.name,
|
||||
email: this.currentUser.email,
|
||||
avatar_url: this.currentUser.avatar_url,
|
||||
identifier_hash: this.currentUser.hmac_identifier,
|
||||
});
|
||||
},
|
||||
filterMenuItemsByRole(menuItems) {
|
||||
if (!this.currentRole) {
|
||||
return [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue