fix: Disable pre-chat fields for identified users (#4234)

This commit is contained in:
Muhsin Keloth 2022-03-22 01:28:22 +05:30 committed by GitHub
parent 7b4cac746a
commit 715400f7ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,12 +40,16 @@ export default {
availableAgents: 'agent/availableAgents',
activeCampaign: 'campaign/getActiveCampaign',
conversationSize: 'conversation/getConversationSize',
currentUser: 'contacts/getCurrentUser',
}),
},
methods: {
startConversation() {
const isUserEmailAvailable = !!this.currentUser.email;
if (this.preChatFormEnabled && !this.conversationSize) {
return this.replaceRoute('prechat-form');
return this.replaceRoute('prechat-form', {
disableContactFields: isUserEmailAvailable,
});
}
return this.replaceRoute('messages');
},