Change to use Promise API instead of callbacks
This commit is contained in:
parent
ef436c6ffb
commit
2560ec148f
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user