From 6afa6db5be0298678ea7a82f746f81a22cac2697 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 10 Jul 2020 11:35:54 -0700 Subject: [PATCH] Conversation.getTitle(): return 'unknown contact' if no data --- _locales/en/messages.json | 4 ++++ js/models/conversations.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 4cf36a8cf..e4b2415ad 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -7,6 +7,10 @@ "message": "Copy error and quit", "description": "Shown in the top-level error popup, allowing user to copy the error text and close the app" }, + "unknownContact": { + "message": "Unknown contact", + "description": "Shown as the name of a contact if we don't have any displayable information about them" + }, "unknownGroup": { "message": "Unknown group", "description": "Shown as the name of a group if we don't have any information about it" diff --git a/js/models/conversations.js b/js/models/conversations.js index b587dff99..baaa07792 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -2320,9 +2320,9 @@ getTitle() { if (this.isPrivate()) { - return this.get('name') || this.getNumber(); + return this.get('name') || this.getNumber() || i18n('unknownContact'); } - return this.get('name') || 'Unknown group'; + return this.get('name') || i18n('unknownGroup'); }, getProfileName() {