diff --git a/src/components/AChat/QuotedMessage.vue b/src/components/AChat/QuotedMessage.vue index 2b5ac374a..c6aa11277 100644 --- a/src/components/AChat/QuotedMessage.vue +++ b/src/components/AChat/QuotedMessage.vue @@ -123,6 +123,10 @@ export default defineComponent({ }) const messageLabel = computed(() => { + if (transaction.value.i18n) { + return t(transaction.value.message) + } + return store.state.options.formatMessages ? formatMessage(transaction.value.message) : transaction.value.message diff --git a/src/lib/chat/helpers/normalizeMessage.js b/src/lib/chat/helpers/normalizeMessage.js index 935c7d613..56fbfef3f 100644 --- a/src/lib/chat/helpers/normalizeMessage.js +++ b/src/lib/chat/helpers/normalizeMessage.js @@ -51,7 +51,7 @@ export function normalizeMessage(abstract) { } else { transaction.type = 'message' } - } else { + } else if (abstract.message.reply_message.type) { // reply with a crypto transfer transaction.asset = abstract.message transaction.message = abstract.message.reply_message.comments || '' @@ -70,6 +70,12 @@ export function normalizeMessage(abstract) { transaction.type = notSupportedYetCrypto || 'UNKNOWN_CRYPTO' transaction.status = TS.UNKNOWN } + } else { + // Unsupported transaction type. May require updating the PWA version. + transaction.message = 'chats.unsupported_transaction_type' + transaction.i18n = true + transaction.hash = abstract.id // adm transaction id (hash) + transaction.type = 'message' } transaction.isReply = true @@ -90,12 +96,18 @@ export function normalizeMessage(abstract) { transaction.type = notSupportedYetCrypto || 'UNKNOWN_CRYPTO' transaction.status = TS.UNKNOWN } - } else { + } else if (typeof abstract.message === 'string') { // ADM transaction or Message transaction.message = abstract.message || '' transaction.hash = abstract.id // adm transaction id (hash) abstract.amount > 0 ? (transaction.type = 'ADM') : (transaction.type = 'message') + } else { + // Unsupported transaction type. May require updating the PWA version. + transaction.message = 'chats.unsupported_transaction_type' + transaction.i18n = true + transaction.hash = abstract.id // adm transaction id (hash) + transaction.type = 'message' } return transaction diff --git a/src/locales/de.json b/src/locales/de.json index 24871f12a..4fac84a98 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -60,7 +60,8 @@ "you_reacted": "Reacted", "partner_reacted": "Reacted", "you_removed_reaction": "Removed reaction", - "partner_removed_reaction": "Removed reaction" + "partner_removed_reaction": "Removed reaction", + "unsupported_transaction_type": "This transaction type is not supported. Please refresh the page or install the latest version of the app." }, "common": { "cancel": "Abbrechen", diff --git a/src/locales/en.json b/src/locales/en.json index 8924e9271..6e4141f49 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -77,7 +77,8 @@ "you_reacted": "Reacted", "partner_reacted": "Reacted", "you_removed_reaction": "Removed reaction", - "partner_removed_reaction": "Removed reaction" + "partner_removed_reaction": "Removed reaction", + "unsupported_transaction_type": "This transaction type is not supported. Please refresh the page or install the latest version of the app." }, "common": { "cancel": "Cancel", diff --git a/src/locales/ru.json b/src/locales/ru.json index 45720cbd9..0a75463f9 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -77,7 +77,8 @@ "you_reacted": "Отреагировали", "partner_reacted": "Отреагировал", "you_removed_reaction": "Убрали реакцию", - "partner_removed_reaction": "Убрал реакцию" + "partner_removed_reaction": "Убрал реакцию", + "unsupported_transaction_type": "Данный тип транзакции не поддерживается. Пожалуйста, обновите страницу, либо установите последнюю версию приложения." }, "common": { "cancel": "Отменить", diff --git a/src/locales/zh.json b/src/locales/zh.json index 486b0760e..904ff88a3 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -77,7 +77,8 @@ "you_reacted": "反应", "partner_reacted": "已反应", "you_removed_reaction": "已删除反应", - "partner_removed_reaction": "已删除的反应" + "partner_removed_reaction": "已删除的反应", + "unsupported_transaction_type": "This transaction type is not supported. Please refresh the page or install the latest version of the app." }, "common": { "cancel": "取消",