fix: reset defaultContainer to AWG when switching to auto mode

This commit is contained in:
NickVs2015
2026-05-26 15:33:59 +03:00
parent cff1e2962c
commit c203540754
2 changed files with 4 additions and 1 deletions
@@ -743,6 +743,9 @@ void SubscriptionController::setCurrentProtocol(const QString &serverId, const Q
auto apiV2 = m_serversRepository->apiV2Config(serverId);
if (apiV2.has_value()) {
apiV2->apiConfig.serviceProtocol = protocolName;
if (protocolName.isEmpty()) {
apiV2->defaultContainer = DockerContainer::Awg;
}
m_serversRepository->editServer(serverId, apiV2->toJson(),
serverConfigUtils::configTypeFromJson(apiV2->toJson()));
}
@@ -159,7 +159,7 @@ PageType {
enabled: !ConnectionController.isConnected || !ServersModel.isDefaultServerCurrentlyProcessed()
text: qsTr("Choose automatically")
descriptionText: qsTr("AmneziaWG is used by default. If the connection is unstable, the app will switch to VLESS. It won't switch back automatically")
descriptionText: qsTr("AmneziaWG is used by default. If the connection is unstable, the app will switch to VLESS. On the next launch, AmneziaWG will be tried again")
onClicked: function() {
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {