You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
q.Promise -> Promise
```
find src spec -name '*.js' |
xargs perl -i -pe 's/q\.Promise/Promise/'
```
This commit is contained in:
@@ -284,7 +284,7 @@ function createDatabase(db) {
|
||||
}
|
||||
|
||||
function promiseifyTxn(txn) {
|
||||
return new q.Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
txn.oncomplete = resolve;
|
||||
txn.onerror = reject;
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ export default class IndexedDBCryptoStore {
|
||||
return this._backendPromise;
|
||||
}
|
||||
|
||||
this._backendPromise = new q.Promise((resolve, reject) => {
|
||||
this._backendPromise = new Promise((resolve, reject) => {
|
||||
if (!this._indexedDB) {
|
||||
reject(new Error('no indexeddb support available'));
|
||||
return;
|
||||
@@ -107,7 +107,7 @@ export default class IndexedDBCryptoStore {
|
||||
* @returns {Promise} resolves when the store has been cleared.
|
||||
*/
|
||||
deleteAllData() {
|
||||
return new q.Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this._indexedDB) {
|
||||
reject(new Error('no indexeddb support available'));
|
||||
return;
|
||||
|
||||
@@ -44,7 +44,7 @@ function createDatabase(db) {
|
||||
*/
|
||||
function selectQuery(store, keyRange, resultMapper) {
|
||||
const query = store.openCursor(keyRange);
|
||||
return q.Promise((resolve, reject) => { /*eslint new-cap: 0*/
|
||||
return Promise((resolve, reject) => { /*eslint new-cap: 0*/
|
||||
const results = [];
|
||||
query.onerror = (event) => {
|
||||
reject(new Error("Query failed: " + event.target.errorCode));
|
||||
@@ -63,7 +63,7 @@ function selectQuery(store, keyRange, resultMapper) {
|
||||
}
|
||||
|
||||
function promiseifyTxn(txn) {
|
||||
return new q.Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
txn.oncomplete = function(event) {
|
||||
resolve(event);
|
||||
};
|
||||
@@ -74,7 +74,7 @@ function promiseifyTxn(txn) {
|
||||
}
|
||||
|
||||
function promiseifyRequest(req) {
|
||||
return new q.Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
req.onsuccess = function(event) {
|
||||
resolve(event);
|
||||
};
|
||||
@@ -163,7 +163,7 @@ LocalIndexedDBStoreBackend.prototype = {
|
||||
* @return {Promise} Resolved when the database is cleared.
|
||||
*/
|
||||
clearDatabase: function() {
|
||||
return new q.Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(`Removing indexeddb instance: ${this._dbName}`);
|
||||
const req = this.indexedDB.deleteDatabase(this._dbName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user