chore: Refactor widget (#5621)

This commit is contained in:
David Kubeš 2022-10-14 05:43:11 +02:00 committed by GitHub
parent e310230f62
commit a6960dc2d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 31 additions and 55 deletions

View file

@ -118,13 +118,10 @@ export default {
const isUserEmailAvailable = !!this.currentUser.email;
const isUserPhoneNumberAvailable = !!this.currentUser.phone_number;
return this.preChatFields.filter(field => {
if (
return !(
(isUserEmailAvailable && field.name === 'emailAddress') ||
(isUserPhoneNumberAvailable && field.name === 'phoneNumber')
) {
return false;
}
return true;
);
});
},
enabledPreChatFields() {