diff --git a/client/ui/qml/Controls2/SwitcherType.qml b/client/ui/qml/Controls2/SwitcherType.qml index 4b41fc26b..b2500b538 100644 --- a/client/ui/qml/Controls2/SwitcherType.qml +++ b/client/ui/qml/Controls2/SwitcherType.qml @@ -153,7 +153,7 @@ Switch { Keys.onSpacePressed: event => handleSwitch(event) function handleSwitch(event) { - if (!event.isAutoRepeat) { + if (root.enabled && !event.isAutoRepeat) { root.checked = !root.checked root.toggled() } diff --git a/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml b/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml index d711ab923..a8a70493d 100644 --- a/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsApiServerInfo.qml @@ -259,6 +259,7 @@ PageType { id: switcher readonly property bool isVlessProtocol: ApiConfigsController.isVlessProtocol() + readonly property bool isProtocolSwitchBlocked: ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected Layout.fillWidth: true Layout.topMargin: 24 @@ -266,6 +267,7 @@ PageType { Layout.leftMargin: 16 visible: ApiAccountInfoModel.data("isProtocolSelectionSupported") + enabled: !switcher.isProtocolSwitchBlocked text: qsTr("Use VLESS protocol") checked: switcher.isVlessProtocol