q(...) -> Promise.resolve

```
find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
```
This commit is contained in:
Richard van der Hoff 2017-07-12 14:02:00 +01:00
parent a06bd84213
commit 0254d2b3a2
25 changed files with 57 additions and 57 deletions

View file

@ -323,9 +323,9 @@ module.exports = React.createClass({
return;
}
// the extra q() ensures that synchronous exceptions hit the same codepath as
// the extra Promise.resolve() ensures that synchronous exceptions hit the same codepath as
// asynchronous ones.
return q().then(() => {
return Promise.resolve().then(() => {
return Lifecycle.loadSession({
fragmentQueryParams: this.props.startingFragmentQueryParams,
enableGuest: this.props.enableGuest,
@ -694,7 +694,7 @@ module.exports = React.createClass({
// Wait for the first sync to complete so that if a room does have an alias,
// it would have been retrieved.
let waitFor = q(null);
let waitFor = Promise.resolve(null);
if (!this.firstSyncComplete) {
if (!this.firstSyncPromise) {
console.warn('Cannot view a room before first sync. room_id:', roomInfo.room_id);