Skip to content

Commit

Permalink
+ crash during download fixed
Browse files Browse the repository at this point in the history
+ providing data in uploading
  • Loading branch information
chrxh committed Oct 15, 2024
1 parent f2291e1 commit 7aa3655
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/Gui/NetworkTransferController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void NetworkTransferController::onDownload(DownloadNetworkResourceRequestData co
auto const& deserializedSimulation = std::get<DeserializedSimulation>(data.resourceData);
try {
_simController->newSimulation(
requestData.resourceName,
data.resourceName,
deserializedSimulation.auxiliaryData.timestep,
deserializedSimulation.auxiliaryData.generalSettings,
deserializedSimulation.auxiliaryData.simulationParameters);
Expand All @@ -60,7 +60,7 @@ void NetworkTransferController::onDownload(DownloadNetworkResourceRequestData co
showMessage("Error", *errorMessage);
_simController->closeSimulation();
_simController->newSimulation(
requestData.resourceName,
data.resourceName,
deserializedSimulation.auxiliaryData.timestep,
deserializedSimulation.auxiliaryData.generalSettings,
deserializedSimulation.auxiliaryData.simulationParameters);
Expand Down
10 changes: 9 additions & 1 deletion source/Gui/UploadSimulationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,19 @@ void _UploadSimulationDialog::onUpload()
{
printOverlayMessage("Uploading ...");

auto data = [&]() -> std::variant<UploadNetworkResourceRequestData::SimulationData, UploadNetworkResourceRequestData::GenomeData> {
if (_resourceType == NetworkResourceType_Simulation) {
return UploadNetworkResourceRequestData::SimulationData{.zoom = Viewport::getZoomFactor(), .center = Viewport::getCenterInWorldPos()};
} else {
return UploadNetworkResourceRequestData::GenomeData{.description = _genomeEditorWindow->getCurrentGenome()};
}
}();
auto workspaceType = _share ? WorkspaceType_Public : WorkspaceType_Private;
NetworkTransferController::get().onUpload(UploadNetworkResourceRequestData{
.folderName = _folder,
.resourceWithoutFolderName = _resourceName,
.resourceDescription = _resourceDescription,
.workspaceType = workspaceType,
.downloadCache = _browserWindow->getSimulationCache()});
.downloadCache = _browserWindow->getSimulationCache(),
.data = data});
}

0 comments on commit 7aa3655

Please sign in to comment.