feat: Show custom attributes in pre-chat form on new conversation (#6735)

This commit is contained in:
Muhsin Keloth
2023-03-23 15:22:49 +05:30
committed by GitHub
parent 856d9067b0
commit a6e7737c56
3 changed files with 3 additions and 20 deletions
@@ -95,12 +95,7 @@ export default {
startNewConversation() {
this.clearConversations();
this.clearConversationAttributes();
// To create a new conversation, we are redirecting
// the user to pre-chat with contact fields disabled
// Pass disableContactFields params to the route
// This would disable the contact fields in the pre-chat form
this.replaceRoute('prechat-form', { disableContactFields: true });
this.replaceRoute('prechat-form');
},
async sendTranscript() {
const { email } = this.currentUser;
@@ -74,10 +74,6 @@ export default {
type: Object,
default: () => {},
},
disableContactFields: {
type: Boolean,
default: false,
},
},
data() {
return {
@@ -114,7 +110,7 @@ export default {
return this.options.preChatMessage;
},
preChatFields() {
return this.disableContactFields ? [] : this.options.preChatFields;
return this.options?.preChatFields || [];
},
filteredPreChatFields() {
const isUserEmailAvailable = !!this.currentUser.email;