fix: Disable form if pre-chat disabled on new conversation (#6813)
This commit is contained in:
@@ -63,12 +63,13 @@ import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
|
|||||||
import { isEmptyObject } from 'widget/helpers/utils';
|
import { isEmptyObject } from 'widget/helpers/utils';
|
||||||
import routerMixin from 'widget/mixins/routerMixin';
|
import routerMixin from 'widget/mixins/routerMixin';
|
||||||
import darkModeMixin from 'widget/mixins/darkModeMixin';
|
import darkModeMixin from 'widget/mixins/darkModeMixin';
|
||||||
|
import configMixin from 'widget/mixins/configMixin';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CustomButton,
|
CustomButton,
|
||||||
Spinner,
|
Spinner,
|
||||||
},
|
},
|
||||||
mixins: [routerMixin, darkModeMixin, messageFormatterMixin],
|
mixins: [routerMixin, darkModeMixin, messageFormatterMixin, configMixin],
|
||||||
props: {
|
props: {
|
||||||
options: {
|
options: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -101,7 +102,7 @@ export default {
|
|||||||
return !isEmptyObject(this.activeCampaign);
|
return !isEmptyObject(this.activeCampaign);
|
||||||
},
|
},
|
||||||
shouldShowHeaderMessage() {
|
shouldShowHeaderMessage() {
|
||||||
return this.hasActiveCampaign || this.options.preChatMessage;
|
return this.hasActiveCampaign || this.preChatFormEnabled;
|
||||||
},
|
},
|
||||||
headerMessage() {
|
headerMessage() {
|
||||||
if (this.hasActiveCampaign) {
|
if (this.hasActiveCampaign) {
|
||||||
@@ -110,7 +111,7 @@ export default {
|
|||||||
return this.options.preChatMessage;
|
return this.options.preChatMessage;
|
||||||
},
|
},
|
||||||
preChatFields() {
|
preChatFields() {
|
||||||
return this.options?.preChatFields || [];
|
return this.preChatFormEnabled ? this.options.preChatFields : [];
|
||||||
},
|
},
|
||||||
filteredPreChatFields() {
|
filteredPreChatFields() {
|
||||||
const isUserEmailAvailable = !!this.currentUser.email;
|
const isUserEmailAvailable = !!this.currentUser.email;
|
||||||
|
|||||||
Reference in New Issue
Block a user