mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 16:18:03 +02:00
change setMapping for new disconnected error case
This commit is contained in:
parent
50a05df721
commit
e3cae5b026
1 changed files with 8 additions and 14 deletions
|
@ -29,22 +29,16 @@ void AssetMappingsScriptingInterface::setMapping(QString path, QString hash, QJS
|
||||||
auto assetClient = DependencyManager::get<AssetClient>();
|
auto assetClient = DependencyManager::get<AssetClient>();
|
||||||
auto request = assetClient->createSetMappingRequest(path, hash);
|
auto request = assetClient->createSetMappingRequest(path, hash);
|
||||||
|
|
||||||
if (request) {
|
connect(request, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
|
||||||
connect(request, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
|
QJSValueList args { uint8_t(request->getError()) };
|
||||||
QJSValueList args { uint8_t(request->getError()) };
|
|
||||||
|
|
||||||
callback.call(args);
|
|
||||||
|
|
||||||
request->deleteLater();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
request->start();
|
|
||||||
} else {
|
|
||||||
// not connected to an Asset Server, return network error
|
|
||||||
QJSValueList args { uint8_t(MappingRequest::NetworkError) };
|
|
||||||
callback.call(args);
|
callback.call(args);
|
||||||
}
|
|
||||||
|
request->deleteLater();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
request->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetMappingsScriptingInterface::getMapping(QString path, QJSValue callback) {
|
void AssetMappingsScriptingInterface::getMapping(QString path, QJSValue callback) {
|
||||||
|
|
Loading…
Reference in a new issue