diff --git a/public/js/components/Messages/Details/TableMessages.js b/public/js/components/Messages/Details/TableMessages.js index aefa8bb2a..d523d5362 100644 --- a/public/js/components/Messages/Details/TableMessages.js +++ b/public/js/components/Messages/Details/TableMessages.js @@ -30,6 +30,7 @@ export default { personId: null, layoutColumnsOnNewData: false, height: '400', + arePhrasesLoaded: false } }, methods: { @@ -195,7 +196,7 @@ export default { ], formatter: (cell, formatterParams) => { const key = formatterParams[cell.getValue()]; - return this.$p.t('messages', key); + return this.$p?.t?.('messages', key) || key; }, }, { @@ -305,8 +306,6 @@ export default { { event: 'tableBuilt', handler: async() => { - await this.$p.loadCategory(['global', 'person', 'stv', 'messages', 'ui', 'notiz']); - const setHeader = (field, text) => { const col = this.$refs.table.tabulator.getColumn(field); if (!col) return; @@ -357,6 +356,12 @@ export default { });*/ }, created(){ + this.$p + .loadCategory(['global', 'person', 'stv', 'messages', 'ui', 'notiz']) + .then(() => { + this.arePhrasesLoaded = true; + }); + if(this.typeId != 'person_id' && Array.isArray(this.id) && this.id.length === 1) { const params = { id: this.id, @@ -381,6 +386,7 @@ export default {