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 RoomListSorter = require("../../RoomListSorter");
|
||||||
var UserActivity = require("../../UserActivity");
|
var UserActivity = require("../../UserActivity");
|
||||||
var Presence = require("../../Presence");
|
var Presence = require("../../Presence");
|
||||||
|
var Resend = require("../../Resend");
|
||||||
var dis = require("../../dispatcher");
|
var dis = require("../../dispatcher");
|
||||||
|
|
||||||
var Login = require("./login/Login");
|
var Login = require("./login/Login");
|
||||||
|
@ -530,6 +531,20 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
}, "mx_Dialog_unknownDevice");
|
}, "mx_Dialog_unknownDevice");
|
||||||
break;
|
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':
|
case 'on_logged_in':
|
||||||
this._onLoggedIn();
|
this._onLoggedIn();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -716,16 +716,16 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onResendAllClick: function() {
|
onResendAllClick: function() {
|
||||||
var eventsToResend = this._getUnsentMessages(this.state.room);
|
dis.dispatch({
|
||||||
eventsToResend.forEach(function(event) {
|
action: 'resend_all_events',
|
||||||
Resend.resend(event);
|
room: this.state.room,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onCancelAllClick: function() {
|
onCancelAllClick: function() {
|
||||||
var eventsToResend = this._getUnsentMessages(this.state.room);
|
dis.dispatch({
|
||||||
eventsToResend.forEach(function(event) {
|
action: 'cancel_all_events',
|
||||||
Resend.removeFromQueue(event);
|
room: this.state.room,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import sdk from '../../../index';
|
import sdk from '../../../index';
|
||||||
|
import dis from '../../../dispatcher';
|
||||||
import MatrixClientPeg from '../../../MatrixClientPeg';
|
import MatrixClientPeg from '../../../MatrixClientPeg';
|
||||||
import GeminiScrollbar from 'react-gemini-scrollbar';
|
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||||
|
|
||||||
|
@ -131,8 +132,8 @@ export default React.createClass({
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
We recommend you go through the verification process
|
We recommend you go through the verification process
|
||||||
for each device before continuing, but you can resend
|
for each device before continuing, but you can retry
|
||||||
the message without verifying if you prefer.
|
without verifying if you prefer.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -160,6 +161,16 @@ export default React.createClass({
|
||||||
<UnknownDeviceList devices={this.props.devices} />
|
<UnknownDeviceList devices={this.props.devices} />
|
||||||
</GeminiScrollbar>
|
</GeminiScrollbar>
|
||||||
<div className="mx_Dialog_buttons">
|
<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 }
|
<button className="mx_Dialog_primary" autoFocus={ true }
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// XXX: temporary logging to try to diagnose
|
// XXX: temporary logging to try to diagnose
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue