From c1e5582cc0a0050b2628f4069807f9cd160c0901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Tue, 17 Aug 2021 13:12:33 +0200 Subject: [PATCH] Fix interactive message submit button by adding a default when none is defined (#5551) Co-authored-by: Mattermod --- .../interactive_dialog_controller.js | 4 +++- assets/base/i18n/en.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/interactive_dialog_controller/interactive_dialog_controller.js b/app/components/interactive_dialog_controller/interactive_dialog_controller.js index 10b139fc9..6b03907ef 100644 --- a/app/components/interactive_dialog_controller/interactive_dialog_controller.js +++ b/app/components/interactive_dialog_controller/interactive_dialog_controller.js @@ -75,6 +75,8 @@ export default class InteractiveDialogController extends PureComponent { } showInteractiveDialogScreen = (dialog) => { + const {formatMessage} = this.context.intl; + const options = { topBar: { leftButtons: [{ @@ -84,7 +86,7 @@ export default class InteractiveDialogController extends PureComponent { rightButtons: [{ id: 'submit-dialog', showAsAction: 'always', - text: dialog.submit_label, + text: dialog.submit_label || formatMessage({id: 'mobile.interactive_dialog.defaultSubmit', defaultMessage: 'Submit'}), }], }, }; diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index cc467edb9..af07a901f 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -361,6 +361,7 @@ "mobile.gallery.title": "{index} of {total}", "mobile.general.error.title": "Error", "mobile.help.title": "Help", + "mobile.interactive_dialog.defaultSubmit": "Submit", "mobile.intro_messages.default_message": "This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.", "mobile.intro_messages.default_welcome": "Welcome to {name}!", "mobile.intro_messages.DM": "This is the start of your direct message history with {teammate}. Direct messages and files shared here are not shown to people outside this area.",