1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-22 08:52:12 +02:00

Allow instantaneous returns for nativeScriptJobs

This commit is contained in:
Dominik Schmidt 2015-11-19 06:19:53 +01:00
parent 17d71b413f
commit 29aa9546a8

@ -886,9 +886,10 @@ Tomahawk.NativeScriptJobManager = {
deferreds: {},
invoke: function (methodName, params) {
var requestId = this.idCounter++;
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));
this.deferreds[requestId] = RSVP.defer();
return this.deferreds[requestId].promise;
var deferred = RSVP.defer();
this.deferreds[requestId] = deferred;
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));;
return deferred.promise;
},
reportNativeScriptJobResult: function (requestId, result) {
var deferred = this.deferreds[requestId];