q(...) -> Promise.resolve

```
find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
```
pull/4565/head
Richard van der Hoff 5 years ago
parent 10decf95f6
commit b29b4a959b
  1. 4
      src/VectorConferenceHandler.js
  2. 4
      src/components/structures/RoomDirectory.js
  3. 4
      src/vector/platform/ElectronPlatform.js
  4. 2
      src/vector/platform/WebPlatform.js
  5. 2
      test/app-tests/joining.js
  6. 4
      test/app-tests/loading.js

@ -57,7 +57,7 @@ ConferenceCall.prototype._joinConferenceUser = function() {
}
var member = groupRoom.getMember(this.confUserId);
if (member && member.membership === "join") {
return q();
return Promise.resolve();
}
return this.client.invite(this.groupRoomId, this.confUserId);
};
@ -75,7 +75,7 @@ ConferenceCall.prototype._getConferenceUserRoom = function() {
}
}
if (confRoom) {
return q(confRoom);
return Promise.resolve(confRoom);
}
return this.client.createRoom({
preset: "private_chat",

@ -117,7 +117,7 @@ module.exports = React.createClass({
},
getMoreRooms: function() {
if (!MatrixClientPeg.get()) return q();
if (!MatrixClientPeg.get()) return Promise.resolve();
const my_filter_string = this.state.filterString;
const my_server = this.state.roomServer;
@ -266,7 +266,7 @@ module.exports = React.createClass({
},
onFillRequest: function(backwards) {
if (backwards || !this.nextBatch) return q(false);
if (backwards || !this.nextBatch) return Promise.resolve(false);
return this.getMoreRooms();
},

@ -173,7 +173,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
}
getAppVersion(): Promise<string> {
return q(remote.app.getVersion());
return Promise.resolve(remote.app.getVersion());
}
startUpdateCheck() {
@ -201,7 +201,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
isElectron(): boolean { return true; }
requestNotificationPermission(): Promise<string> {
return q('granted');
return Promise.resolve('granted');
}
reload() {

@ -132,7 +132,7 @@ export default class WebPlatform extends VectorBasePlatform {
getAppVersion(): Promise<string> {
if (this.runningVersion !== null) {
return q(this.runningVersion);
return Promise.resolve(this.runningVersion);
}
return this._getVersion();
}

@ -106,7 +106,7 @@ describe('joining a room', function () {
.respond(200, {});
function awaitSync(attempts) {
if (syncDone) {
return q();
return Promise.resolve();
}
if (!attempts) {
throw new Error("Gave up waiting for /sync")

@ -683,7 +683,7 @@ function awaitSyncingSpinner(matrixChat, retryLimit, retryCount) {
// state looks good, check the rendered output
assertAtSyncingSpinner(matrixChat);
return q();
return Promise.resolve();
}
function assertAtSyncingSpinner(matrixChat) {
@ -721,5 +721,5 @@ function awaitRoomView(matrixChat, retryLimit, retryCount) {
// state looks good, check the rendered output
ReactTestUtils.findRenderedComponentWithType(
matrixChat, sdk.getComponent('structures.RoomView'));
return q();
return Promise.resolve();
}

Loading…
Cancel
Save