mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 22:31:27 +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 request = assetClient->createSetMappingRequest(path, hash);
|
||||
|
||||
if (request) {
|
||||
connect(request, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
|
||||
QJSValueList args { uint8_t(request->getError()) };
|
||||
connect(request, &SetMappingRequest::finished, this, [this, callback](SetMappingRequest* request) mutable {
|
||||
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);
|
||||
}
|
||||
|
||||
request->deleteLater();
|
||||
|
||||
});
|
||||
|
||||
request->start();
|
||||
}
|
||||
|
||||
void AssetMappingsScriptingInterface::getMapping(QString path, QJSValue callback) {
|
||||
|
|
Loading…
Reference in a new issue