if the container already exists, then add it to the list of containers in the client

This commit is contained in:
vladimir.kuznetsov 2023-02-07 10:39:18 +03:00
parent b2fd94d20e
commit b5778a9cb5
2 changed files with 3 additions and 3 deletions

View file

@ -87,11 +87,11 @@ void ServerContainersLogic::onPushButtonContinueClicked(DockerContainer c, int p
emit uiLogic()->goToPage(Page::ServerConfiguringProgress);
qApp->processEvents();
ErrorCode e = uiLogic()->pageLogic<ServerConfiguringProgressLogic>()->doInstallAction([this, c, &config](){
ErrorCode error = uiLogic()->pageLogic<ServerConfiguringProgressLogic>()->doInstallAction([this, c, &config](){
return m_serverController->setupContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), c, config);
});
if (!e) {
if (error == ErrorCode::NoError || error == ErrorCode::ServerContainerAlreadyInstalledError) {
m_settings->setContainerConfig(uiLogic()->selectedServerIndex, c, config);
if (ContainerProps::containerService(c) == ServiceType::Vpn) {
m_settings->setDefaultContainer(uiLogic()->selectedServerIndex, c);

View file

@ -337,7 +337,7 @@ void UiLogic::installServer(QMap<DockerContainer, QJsonObject> &containers)
m_serverController->disconnectFromHost(installCredentials);
}
if (error == ErrorCode::NoError) {
if (error == ErrorCode::NoError || error == ErrorCode::ServerContainerAlreadyInstalledError) {
QJsonObject server;
server.insert(config_key::hostName, installCredentials.hostName);
server.insert(config_key::userName, installCredentials.userName);