Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
If HttpStatus == 413, refresh media limits
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Jun 21, 2018
1 parent 2931626 commit 3948ca9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ContentMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ class ContentMessages {
}
}
if (error) {
dis.dispatch({action: 'upload_failed', upload: upload});
dis.dispatch({action: 'upload_failed', upload, error});
} else {
dis.dispatch({action: 'upload_finished', upload: upload});
dis.dispatch({action: 'upload_finished', upload});
}
});
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/structures/RoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,10 @@ module.exports = React.createClass({
break;
case 'notifier_enabled':
case 'upload_failed':
this._fetchMediaLimits(true);
// 413: File was too big or upset the server in some way.
if(payload.data.error.http_status === 413) {
this._fetchMediaLimits(true);
}
case 'upload_started':
case 'upload_finished':
this.forceUpdate();
Expand Down

0 comments on commit 3948ca9

Please sign in to comment.