Split up CSS; use .catch instead of .then

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston 2017-09-29 13:33:14 -06:00
parent 078ee54edf
commit 2d153a72c1
4 changed files with 69 additions and 52 deletions

View file

@ -135,7 +135,7 @@ module.exports = React.createClass({
onPinClick: function() {
MatrixClientPeg.get().getStateEvent(this.props.mxEvent.getRoomId(), 'm.room.pinned_events', '')
.then(null, e => {
.catch(e => {
// Intercept the Event Not Found error and fall through the promise chain with no event.
if (e.errcode === "M_NOT_FOUND") return null;
throw e;