fix: Disable pre-chat fields for identified users (#4234)
This commit is contained in:
@@ -40,12 +40,16 @@ export default {
|
|||||||
availableAgents: 'agent/availableAgents',
|
availableAgents: 'agent/availableAgents',
|
||||||
activeCampaign: 'campaign/getActiveCampaign',
|
activeCampaign: 'campaign/getActiveCampaign',
|
||||||
conversationSize: 'conversation/getConversationSize',
|
conversationSize: 'conversation/getConversationSize',
|
||||||
|
currentUser: 'contacts/getCurrentUser',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
startConversation() {
|
startConversation() {
|
||||||
|
const isUserEmailAvailable = !!this.currentUser.email;
|
||||||
if (this.preChatFormEnabled && !this.conversationSize) {
|
if (this.preChatFormEnabled && !this.conversationSize) {
|
||||||
return this.replaceRoute('prechat-form');
|
return this.replaceRoute('prechat-form', {
|
||||||
|
disableContactFields: isUserEmailAvailable,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return this.replaceRoute('messages');
|
return this.replaceRoute('messages');
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user