mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
fixed reset api button for non-default server
This commit is contained in:
@@ -564,9 +564,9 @@ void InstallController::removeProcessedContainer()
|
|||||||
emit installationErrorOccurred(errorString(errorCode));
|
emit installationErrorOccurred(errorString(errorCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstallController::removeApiConfig()
|
void InstallController::removeApiConfig(const int serverIndex)
|
||||||
{
|
{
|
||||||
auto serverConfig = m_serversModel->getServerConfig(m_serversModel->getDefaultServerIndex());
|
auto serverConfig = m_serversModel->getServerConfig(serverIndex);
|
||||||
|
|
||||||
#ifdef Q_OS_IOS
|
#ifdef Q_OS_IOS
|
||||||
QString vpncName = QString("%1 (%2) %3")
|
QString vpncName = QString("%1 (%2) %3")
|
||||||
@@ -584,7 +584,7 @@ void InstallController::removeApiConfig()
|
|||||||
|
|
||||||
serverConfig.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None));
|
serverConfig.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None));
|
||||||
|
|
||||||
m_serversModel->editServer(serverConfig, m_serversModel->getDefaultServerIndex());
|
m_serversModel->editServer(serverConfig, serverIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InstallController::clearCachedProfile()
|
void InstallController::clearCachedProfile()
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public slots:
|
|||||||
void removeAllContainers();
|
void removeAllContainers();
|
||||||
void removeProcessedContainer();
|
void removeProcessedContainer();
|
||||||
|
|
||||||
void removeApiConfig();
|
void removeApiConfig(const int serverIndex);
|
||||||
|
|
||||||
void clearCachedProfile();
|
void clearCachedProfile();
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ PageType {
|
|||||||
PageController.showNotificationMessage(qsTr("Cannot reset API config during active connection"))
|
PageController.showNotificationMessage(qsTr("Cannot reset API config during active connection"))
|
||||||
} else {
|
} else {
|
||||||
PageController.showBusyIndicator(true)
|
PageController.showBusyIndicator(true)
|
||||||
InstallController.removeApiConfig()
|
InstallController.removeApiConfig(ServersModel.processedIndex)
|
||||||
PageController.showBusyIndicator(false)
|
PageController.showBusyIndicator(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user