diff --git a/app/javascript/dashboard/components/widgets/conversation/bubble/File.vue b/app/javascript/dashboard/components/widgets/conversation/bubble/File.vue index a8f2993d3..5861e0df1 100644 --- a/app/javascript/dashboard/components/widgets/conversation/bubble/File.vue +++ b/app/javascript/dashboard/components/widgets/conversation/bubble/File.vue @@ -29,8 +29,11 @@ export default { }, computed: { fileName() { - const filename = this.url.substring(this.url.lastIndexOf('/') + 1); - return filename; + if (this.url) { + const filename = this.url.substring(this.url.lastIndexOf('/') + 1); + return filename || this.$t('CONVERSATION.UNKNOWN_FILE_TYPE'); + } + return this.$t('CONVERSATION.UNKNOWN_FILE_TYPE'); }, }, methods: { diff --git a/app/javascript/dashboard/i18n/locale/en/conversation.json b/app/javascript/dashboard/i18n/locale/en/conversation.json index ac25a5aed..e545ce0d2 100644 --- a/app/javascript/dashboard/i18n/locale/en/conversation.json +++ b/app/javascript/dashboard/i18n/locale/en/conversation.json @@ -30,6 +30,7 @@ "REPLYING_TO": "You are replying to:", "REMOVE_SELECTION": "Remove Selection", "DOWNLOAD": "Download", + "UNKNOWN_FILE_TYPE": "Unknown File", "UPLOADING_ATTACHMENTS": "Uploading attachments...", "SUCCESS_DELETE_MESSAGE": "Message deleted successfully", "FAIL_DELETE_MESSSAGE": "Couldn't delete message! Try again",