mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 03:05:51 +03:00
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
6 changed files with 10 additions and 10 deletions
|
@ -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…
Reference in a new issue