This commit is contained in:
j3d1 2024-06-07 22:54:56 +02:00
parent 3ebe51645a
commit 2a0fd8649d

View file

@ -4,7 +4,8 @@
<li v-for="[template, index] in localChanges" :key="template.id"> <li v-for="[template, index] in localChanges" :key="template.id">
<b>{{ template.name }}</b><br> <b>{{ template.name }}</b><br>
<FormatedText :value="template.message" :format="formatText" class="template-message" <FormatedText :value="template.message" :format="formatText" class="template-message"
@input="changeMessageTemplate(template.id, $event)"/><br> @input="changeMessageTemplate(template.id, $event)"/>
<br>
<button class="btn btn-primary" <button class="btn btn-primary"
:disabled="template.message !== messageTemplates[index].message">Reset :disabled="template.message !== messageTemplates[index].message">Reset
</button> </button>
@ -52,11 +53,12 @@ export default {
} }
}, },
mounted() { mounted() {
this.fetchMessageTemplates(); this.fetchMessageTemplates().then(() => {
this.fetchMessageTemplateVariables(); this.localChanges = this.messageTemplates.map(template => {
this.localChanges = this.messageTemplates.map(template => { return {id: template.id, message: template.message, name: template.name};
return {id: template.id, message: template.message, name: template.name}; });
}); });
this.fetchMessageTemplateVariables();
}, },
}; };
</script> </script>