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">
<b>{{ template.name }}</b><br>
<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"
:disabled="template.message !== messageTemplates[index].message">Reset
</button>
@ -52,11 +53,12 @@ export default {
}
},
mounted() {
this.fetchMessageTemplates();
this.fetchMessageTemplateVariables();
this.localChanges = this.messageTemplates.map(template => {
return {id: template.id, message: template.message, name: template.name};
this.fetchMessageTemplates().then(() => {
this.localChanges = this.messageTemplates.map(template => {
return {id: template.id, message: template.message, name: template.name};
});
});
this.fetchMessageTemplateVariables();
},
};
</script>