q(...) -> Promise.resolve
``` find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/' ```
This commit is contained in:
parent
10decf95f6
commit
b29b4a959b
|
@ -57,7 +57,7 @@ ConferenceCall.prototype._joinConferenceUser = function() {
|
||||||
}
|
}
|
||||||
var member = groupRoom.getMember(this.confUserId);
|
var member = groupRoom.getMember(this.confUserId);
|
||||||
if (member && member.membership === "join") {
|
if (member && member.membership === "join") {
|
||||||
return q();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return this.client.invite(this.groupRoomId, this.confUserId);
|
return this.client.invite(this.groupRoomId, this.confUserId);
|
||||||
};
|
};
|
||||||
|
@ -75,7 +75,7 @@ ConferenceCall.prototype._getConferenceUserRoom = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (confRoom) {
|
if (confRoom) {
|
||||||
return q(confRoom);
|
return Promise.resolve(confRoom);
|
||||||
}
|
}
|
||||||
return this.client.createRoom({
|
return this.client.createRoom({
|
||||||
preset: "private_chat",
|
preset: "private_chat",
|
||||||
|
|
|
@ -117,7 +117,7 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
getMoreRooms: function() {
|
getMoreRooms: function() {
|
||||||
if (!MatrixClientPeg.get()) return q();
|
if (!MatrixClientPeg.get()) return Promise.resolve();
|
||||||
|
|
||||||
const my_filter_string = this.state.filterString;
|
const my_filter_string = this.state.filterString;
|
||||||
const my_server = this.state.roomServer;
|
const my_server = this.state.roomServer;
|
||||||
|
@ -266,7 +266,7 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onFillRequest: function(backwards) {
|
onFillRequest: function(backwards) {
|
||||||
if (backwards || !this.nextBatch) return q(false);
|
if (backwards || !this.nextBatch) return Promise.resolve(false);
|
||||||
|
|
||||||
return this.getMoreRooms();
|
return this.getMoreRooms();
|
||||||
},
|
},
|
||||||
|
|
|
@ -173,7 +173,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
}
|
}
|
||||||
|
|
||||||
getAppVersion(): Promise<string> {
|
getAppVersion(): Promise<string> {
|
||||||
return q(remote.app.getVersion());
|
return Promise.resolve(remote.app.getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
startUpdateCheck() {
|
startUpdateCheck() {
|
||||||
|
@ -201,7 +201,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
isElectron(): boolean { return true; }
|
isElectron(): boolean { return true; }
|
||||||
|
|
||||||
requestNotificationPermission(): Promise<string> {
|
requestNotificationPermission(): Promise<string> {
|
||||||
return q('granted');
|
return Promise.resolve('granted');
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
|
|
|
@ -132,7 +132,7 @@ export default class WebPlatform extends VectorBasePlatform {
|
||||||
|
|
||||||
getAppVersion(): Promise<string> {
|
getAppVersion(): Promise<string> {
|
||||||
if (this.runningVersion !== null) {
|
if (this.runningVersion !== null) {
|
||||||
return q(this.runningVersion);
|
return Promise.resolve(this.runningVersion);
|
||||||
}
|
}
|
||||||
return this._getVersion();
|
return this._getVersion();
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ describe('joining a room', function () {
|
||||||
.respond(200, {});
|
.respond(200, {});
|
||||||
function awaitSync(attempts) {
|
function awaitSync(attempts) {
|
||||||
if (syncDone) {
|
if (syncDone) {
|
||||||
return q();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
if (!attempts) {
|
if (!attempts) {
|
||||||
throw new Error("Gave up waiting for /sync")
|
throw new Error("Gave up waiting for /sync")
|
||||||
|
|
|
@ -683,7 +683,7 @@ function awaitSyncingSpinner(matrixChat, retryLimit, retryCount) {
|
||||||
|
|
||||||
// state looks good, check the rendered output
|
// state looks good, check the rendered output
|
||||||
assertAtSyncingSpinner(matrixChat);
|
assertAtSyncingSpinner(matrixChat);
|
||||||
return q();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
function assertAtSyncingSpinner(matrixChat) {
|
function assertAtSyncingSpinner(matrixChat) {
|
||||||
|
@ -721,5 +721,5 @@ function awaitRoomView(matrixChat, retryLimit, retryCount) {
|
||||||
// state looks good, check the rendered output
|
// state looks good, check the rendered output
|
||||||
ReactTestUtils.findRenderedComponentWithType(
|
ReactTestUtils.findRenderedComponentWithType(
|
||||||
matrixChat, sdk.getComponent('structures.RoomView'));
|
matrixChat, sdk.getComponent('structures.RoomView'));
|
||||||
return q();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue