From 2560ec148f66ae97a9e3bfc8c7d631f58865c2cc Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Sun, 13 Nov 2022 09:16:46 -0500 Subject: [PATCH] Change to use Promise API instead of callbacks --- js/ui/realms/realmSearchProvider.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/ui/realms/realmSearchProvider.js b/js/ui/realms/realmSearchProvider.js index 090af285c..56c5989c1 100644 --- a/js/ui/realms/realmSearchProvider.js +++ b/js/ui/realms/realmSearchProvider.js @@ -262,7 +262,7 @@ var RealmSearchProvider = class RealmSearchProvider { } } - getResultMetas (ids, callback) { + getResultMetas (ids) { let metas = []; for (let id of ids) { @@ -277,7 +277,7 @@ var RealmSearchProvider = class RealmSearchProvider { } } } - callback(metas); + return new Promise(resolve => resolve(metas)); } activateResult (resultId, _terms) { @@ -300,7 +300,7 @@ var RealmSearchProvider = class RealmSearchProvider { return results.slice(0, maxNumber) } - getInitialResultSet(terms, callback, _cancellable) { + getInitialResultSet(terms, _cancellable) { let realms = this._shellRealms.get_all_realms(); let matches = []; @@ -316,10 +316,10 @@ var RealmSearchProvider = class RealmSearchProvider { } } } - callback(matches); + return new Promise(resolve => resolve(matches)); } - getSubsearchResultSet(previousResults, terms, callback, cancellable) { - this.getInitialResultSet(terms, callback, cancellable) + getSubsearchResultSet(previousResults, terms, cancellable) { + return this.getInitialResultSet(terms, cancellable); } }