mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Replace q.allSettled()
Bluebird doesn't have an `allSettled` method, so instead catch the exceptions and use `all`.
This commit is contained in:
parent
4c5b5ca0ba
commit
1d2d086a58
@ -431,7 +431,9 @@ module.exports = React.createClass({
|
|||||||
'global', kind, LEGACY_RULES[rule.rule_id], portLegacyActions(rule.actions)
|
'global', kind, LEGACY_RULES[rule.rule_id], portLegacyActions(rule.actions)
|
||||||
).then( function() {
|
).then( function() {
|
||||||
return cli.deletePushRule('global', kind, rule.rule_id);
|
return cli.deletePushRule('global', kind, rule.rule_id);
|
||||||
})
|
}).catch( (e) => {
|
||||||
|
console.warn(`Error when porting legacy rule: ${e}`);
|
||||||
|
});
|
||||||
}(kind, rule));
|
}(kind, rule));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,7 +442,7 @@ module.exports = React.createClass({
|
|||||||
if (needsUpdate.length > 0) {
|
if (needsUpdate.length > 0) {
|
||||||
// If some of the rules need to be ported then wait for the porting
|
// If some of the rules need to be ported then wait for the porting
|
||||||
// to happen and then fetch the rules again.
|
// to happen and then fetch the rules again.
|
||||||
return q.allSettled(needsUpdate).then( function() {
|
return q.all(needsUpdate).then( function() {
|
||||||
return cli.getPushRules();
|
return cli.getPushRules();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user