From 2c15d5b4f3445691a7b1ae734001b3ce3fccc3a1 Mon Sep 17 00:00:00 2001 From: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> Date: Mon, 14 Feb 2022 15:52:15 +0530 Subject: [PATCH] fix: Custom attribute not getting changed on conversations (#3965) --- .../dashboard/components/CustomAttribute.vue | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/app/javascript/dashboard/components/CustomAttribute.vue b/app/javascript/dashboard/components/CustomAttribute.vue index 41773b125..b9b769c44 100644 --- a/app/javascript/dashboard/components/CustomAttribute.vue +++ b/app/javascript/dashboard/components/CustomAttribute.vue @@ -141,16 +141,6 @@ export default { editedValue: null, }; }, - validations() { - if (this.isAttributeTypeLink) { - return { - editedValue: { required, url }, - }; - } - return { - editedValue: { required }, - }; - }, computed: { formattedValue() { @@ -209,6 +199,23 @@ export default { return this.editedValue; }, }, + watch: { + value() { + this.isEditing = false; + this.editedValue = this.value; + }, + }, + + validations() { + if (this.isAttributeTypeLink) { + return { + editedValue: { required, url }, + }; + } + return { + editedValue: { required }, + }; + }, mounted() { this.editedValue = this.formattedValue; bus.$on(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, focusAttributeKey => {