From 4c5b5ca0ba8cd55316229b4d0bc6b697dfc24022 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 13 Jul 2017 00:37:04 +0100 Subject: [PATCH] replace `q.Promise` with `new Promise` --- src/vector/rageshake.js | 8 ++++---- test/test-utils.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vector/rageshake.js b/src/vector/rageshake.js index 05f00d659e..d097741471 100644 --- a/src/vector/rageshake.js +++ b/src/vector/rageshake.js @@ -116,7 +116,7 @@ class IndexedDBLogStore { */ connect() { let req = this.indexedDB.open("logs"); - return q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { req.onsuccess = (event) => { this.db = event.target.result; // Periodically flush logs to local storage / indexeddb @@ -193,7 +193,7 @@ class IndexedDBLogStore { } // there is no flush promise or there was but it has finished, so do // a brand new one, destroying the chain which may have been built up. - this.flushPromise = q.Promise((resolve, reject) => { + this.flushPromise = new Promise((resolve, reject) => { if (!this.db) { // not connected yet or user rejected access for us to r/w to // the db. @@ -277,7 +277,7 @@ class IndexedDBLogStore { } function deleteLogs(id) { - return q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const txn = db.transaction( ["logs", "logslastmod"], "readwrite" ); @@ -375,7 +375,7 @@ class IndexedDBLogStore { */ function selectQuery(store, keyRange, resultMapper) { const query = store.openCursor(keyRange); - return q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { let results = []; query.onerror = (event) => { reject(new Error("Query failed: " + event.target.errorCode)); diff --git a/test/test-utils.js b/test/test-utils.js index 88ac9d99b6..007883df69 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -28,7 +28,7 @@ export function browserSupportsWebRTC() { } export function deleteIndexedDB(dbName) { - return new q.Promise((resolve, reject) => { + return new Promise((resolve, reject) => { if (!window.indexedDB) { resolve(); return;