Skip to content

Commit

Permalink
fix: tranlation sample forms
Browse files Browse the repository at this point in the history
  • Loading branch information
acnormun committed May 8, 2024
1 parent 8c3ef68 commit 621a349
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/whatsAppTemplates/FormTabContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@
.toLowerCase();
});
},
beforeUnmount(){
this.resetTemplates();
},
computed: {
...mapState(whatsapp_store, [
'templateTranslationCurrentForm',
Expand Down
3 changes: 1 addition & 2 deletions src/components/whatsAppTemplates/TranslationSampleForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
},
data() {
return {
variablesData: [],
textInput: '',
variablesData: [],
formattedBody: '',
file: null,
fileToPreview: null,
Expand Down Expand Up @@ -122,7 +122,6 @@
this.$emit('close-modal');
},
handleVariableChange(index, event) {
this.textInput = event;
this.variablesData[index] = event;
let newBody = this.templateTranslationCurrentForm.body;
this.variablesData.forEach((variable, index) => {
Expand Down
6 changes: 5 additions & 1 deletion src/stores/modules/appType/channels/whatsapp.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ export const whatsapp_store = defineStore('whatsapp', {
this.fetchedContactInfo = false;
},
resetTemplates() {
this.templateTranslationForms = null;
this.templateTranslationForms = {};
this.templateForm = {
name: null,
category: null,
};
},
async fetchWppContactInfo({ code, appUuid }) {
this.loadingContactInfo = true;
Expand Down

0 comments on commit 621a349

Please sign in to comment.