Fix upload cancel in e2e rooms
This is a bit of a mess of passing promises around - we weren't taking the right promise to pass to cancelUpload. Also e2e uploads take time to read into memory & encrypt, so allow cancelling them during those phases too, even though we can't abort those phases before they're done - we do mark the upload as cancelled though so filter the current uploads for cancelled ones. Fixes https://github.com/vector-im/riot-web/issues/4891
This commit is contained in:
parent
054011f5f8
commit
59210564b7
3 changed files with 30 additions and 14 deletions
|
@ -543,6 +543,7 @@ module.exports = React.createClass({
|
|||
case 'notifier_enabled':
|
||||
case 'upload_started':
|
||||
case 'upload_finished':
|
||||
case 'upload_canceled':
|
||||
this.forceUpdate();
|
||||
break;
|
||||
case 'call_state':
|
||||
|
|
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||
|
||||
const React = require('react');
|
||||
import PropTypes from 'prop-types';
|
||||
const ContentMessages = require('../../ContentMessages');
|
||||
import ContentMessages from '../../ContentMessages';
|
||||
const dis = require('../../dispatcher');
|
||||
const filesize = require('filesize');
|
||||
import { _t } from '../../languageHandler';
|
||||
|
@ -40,6 +40,7 @@ module.exports = React.createClass({displayName: 'UploadBar',
|
|||
switch (payload.action) {
|
||||
case 'upload_progress':
|
||||
case 'upload_finished':
|
||||
case 'upload_canceled':
|
||||
case 'upload_failed':
|
||||
if (this.mounted) this.forceUpdate();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue