fix: Fixes cc bcc being sent when mail head is empty (#3515)

* fix: Fixes cc bcc being sent wrongly with emails

* fixes values not sycned to parent component

* Update app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue

* Review fixes
This commit is contained in:
Nithin David Thomas
2021-12-07 23:44:32 +05:30
committed by GitHub
parent 46afcd9348
commit 824101bc30
2 changed files with 27 additions and 18 deletions

View File

@@ -55,9 +55,13 @@
import { validEmailsByComma } from './helpers/emailHeadHelper';
export default {
props: {
clearMails: {
type: Boolean,
default: false,
ccEmails: {
type: String,
default: '',
},
bccEmails: {
type: String,
default: '',
},
},
data() {
@@ -67,6 +71,18 @@ export default {
bccEmailsVal: '',
};
},
watch: {
bccEmails(newVal) {
if (newVal !== this.bccEmailsVal) {
this.bccEmailsVal = newVal;
}
},
ccEmails(newVal) {
if (newVal !== this.ccEmailsVal) {
this.ccEmailsVal = newVal;
}
},
},
validations: {
ccEmailsVal: {
hasValidEmails(value) {
@@ -85,18 +101,10 @@ export default {
},
onBlur() {
this.$v.$touch();
this.$emit("set-emails", { bccEmails: this.bccEmailsVal, ccEmails: this.ccEmailsVal });
this.$emit('update:bccEmails', this.bccEmailsVal);
this.$emit('update:ccEmails', this.ccEmailsVal);
},
},
watch: {
clearMails: function(value){
if(value) {
this.ccEmailsVal = '';
this.bccEmailsVal = '';
this.clearMails = false;
}
}
}
};
</script>
<style lang="scss" scoped>