mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 13:49:46 +02:00
Merge pull request #8337 from humbletim/fix-Assets-getMapping
fix Assets.getMapping(path, callback) to return a value
This commit is contained in:
commit
604c8f4a36
1 changed files with 3 additions and 1 deletions
|
@ -62,8 +62,10 @@ void AssetMappingsScriptingInterface::getMapping(QString path, QJSValue callback
|
||||||
auto request = assetClient->createGetMappingRequest(path);
|
auto request = assetClient->createGetMappingRequest(path);
|
||||||
|
|
||||||
connect(request, &GetMappingRequest::finished, this, [this, callback](GetMappingRequest* request) mutable {
|
connect(request, &GetMappingRequest::finished, this, [this, callback](GetMappingRequest* request) mutable {
|
||||||
|
auto hash = request->getHash();
|
||||||
|
|
||||||
if (callback.isCallable()) {
|
if (callback.isCallable()) {
|
||||||
QJSValueList args { request->getErrorString() };
|
QJSValueList args { request->getErrorString(), hash };
|
||||||
callback.call(args);
|
callback.call(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue