Add "Retry" button to UDE
This commit is contained in:
parent
878e31eba2
commit
c13ff254b1
3 changed files with 34 additions and 8 deletions
|
@ -26,6 +26,7 @@ var ContextualMenu = require("./ContextualMenu");
|
|||
var RoomListSorter = require("../../RoomListSorter");
|
||||
var UserActivity = require("../../UserActivity");
|
||||
var Presence = require("../../Presence");
|
||||
var Resend = require("../../Resend");
|
||||
var dis = require("../../dispatcher");
|
||||
|
||||
var Login = require("./login/Login");
|
||||
|
@ -530,6 +531,20 @@ module.exports = React.createClass({
|
|||
},
|
||||
}, "mx_Dialog_unknownDevice");
|
||||
break;
|
||||
case 'resend_all_events':
|
||||
payload.room.getPendingEvents().filter(function(ev) {
|
||||
return ev.status === Matrix.EventStatus.NOT_SENT;
|
||||
}).forEach(function(event) {
|
||||
Resend.resend(event);
|
||||
});
|
||||
break;
|
||||
case 'cancel_all_events':
|
||||
payload.room.getPendingEvents().filter(function(ev) {
|
||||
return ev.status === Matrix.EventStatus.NOT_SENT;
|
||||
}).forEach(function(event) {
|
||||
Resend.removeFromQueue(event);
|
||||
});
|
||||
break;
|
||||
case 'on_logged_in':
|
||||
this._onLoggedIn();
|
||||
break;
|
||||
|
|
|
@ -716,16 +716,16 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
onResendAllClick: function() {
|
||||
var eventsToResend = this._getUnsentMessages(this.state.room);
|
||||
eventsToResend.forEach(function(event) {
|
||||
Resend.resend(event);
|
||||
dis.dispatch({
|
||||
action: 'resend_all_events',
|
||||
room: this.state.room,
|
||||
});
|
||||
},
|
||||
|
||||
onCancelAllClick: function() {
|
||||
var eventsToResend = this._getUnsentMessages(this.state.room);
|
||||
eventsToResend.forEach(function(event) {
|
||||
Resend.removeFromQueue(event);
|
||||
dis.dispatch({
|
||||
action: 'cancel_all_events',
|
||||
room: this.state.room,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
import React from 'react';
|
||||
import sdk from '../../../index';
|
||||
import dis from '../../../dispatcher';
|
||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||
|
||||
|
@ -131,8 +132,8 @@ export default React.createClass({
|
|||
</p>
|
||||
<p>
|
||||
We recommend you go through the verification process
|
||||
for each device before continuing, but you can resend
|
||||
the message without verifying if you prefer.
|
||||
for each device before continuing, but you can retry
|
||||
without verifying if you prefer.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
@ -160,6 +161,16 @@ export default React.createClass({
|
|||
<UnknownDeviceList devices={this.props.devices} />
|
||||
</GeminiScrollbar>
|
||||
<div className="mx_Dialog_buttons">
|
||||
<button className="mx_Dialog_primary" autoFocus={ true }
|
||||
onClick={() => {
|
||||
this.props.onFinished();
|
||||
dis.dispatch({
|
||||
action: 'resend_all_events',
|
||||
room: this.props.room,
|
||||
});
|
||||
}}>
|
||||
Retry
|
||||
</button>
|
||||
<button className="mx_Dialog_primary" autoFocus={ true }
|
||||
onClick={() => {
|
||||
// XXX: temporary logging to try to diagnose
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue