From e6dbc3b863a7010a14e58c24abeddd933eb70870 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Sat, 23 Dec 2017 16:50:45 +1300 Subject: [PATCH] Use DialogButtons in UnknownDeviceDialog Use DialogButtons to eliminate duplicate button code. --- .../views/dialogs/UnknownDeviceDialog.js | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/components/views/dialogs/UnknownDeviceDialog.js b/src/components/views/dialogs/UnknownDeviceDialog.js index 9c19ee6eca..b81700cac0 100644 --- a/src/components/views/dialogs/UnknownDeviceDialog.js +++ b/src/components/views/dialogs/UnknownDeviceDialog.js @@ -187,18 +187,11 @@ export default React.createClass({ } }); }); - let sendButton; - if (haveUnknownDevices) { - sendButton = ; - } else { - sendButton = ; - } + const sendButtonOnClick = haveUnknownDevices ? this._onSendAnywayClicked : this._onSendClicked; + const sendButtonLabel = haveUnknownDevices ? this.props.sendAnywayLabel : this.props.sendAnywayLabel; const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); + const DialogButtons = sdk.getComponent('views.elements.DialogButtons'); return ( -
- {sendButton} - -
+
); // XXX: do we want to give the user the option to enable blacklistUnverifiedDevices for this room (or globally) at this point?