1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

q(...) -> Promise.resolve

```
find src spec -name '*.js' |
    xargs perl -i -pe 's/\bq(\([^(]*\))/Promise.resolve$1/'
```
This commit is contained in:
Richard van der Hoff
2017-07-10 16:04:25 +01:00
parent b96062b6de
commit a5d3dd942e
24 changed files with 92 additions and 92 deletions

View File

@@ -113,7 +113,7 @@ LocalIndexedDBStoreBackend.prototype = {
*/
connect: function() {
if (this.db) {
return q();
return Promise.resolve();
}
const req = this.indexedDB.open(this._dbName, VERSION);
req.onupgradeneeded = (ev) => {
@@ -204,18 +204,18 @@ LocalIndexedDBStoreBackend.prototype = {
if (copy === undefined) copy = true;
const data = this._syncAccumulator.getJSON();
if (!data.nextBatch) return q(null);
if (!data.nextBatch) return Promise.resolve(null);
if (copy) {
// We must deep copy the stored data so that the /sync processing code doesn't
// corrupt the internal state of the sync accumulator (it adds non-clonable keys)
return q(utils.deepCopy(data));
return Promise.resolve(utils.deepCopy(data));
} else {
return q(data);
return Promise.resolve(data);
}
},
setSyncData: function(syncData) {
return q().then(() => {
return Promise.resolve().then(() => {
this._syncAccumulator.accumulate(syncData);
});
},