From 9dd6bbca905fb2499bbeedb32da33ff025d58a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Sa=C5=A1ek?= Date: Tue, 27 Apr 2021 19:34:48 +0200 Subject: [PATCH 1/2] Fix switching Wi-Fi modes depending on bands in WiFiForm --- src/common/WiFiSettings/WiFiForm.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/WiFiSettings/WiFiForm.js b/src/common/WiFiSettings/WiFiForm.js index 4be8fc4..b9e1bc6 100644 --- a/src/common/WiFiSettings/WiFiForm.js +++ b/src/common/WiFiSettings/WiFiForm.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. @@ -163,6 +163,10 @@ function DeviceForm({ [deviceIndex]: { hwmode: { $set: value }, channel: { $set: "0" }, + htmode: { + $set: + value === "11a" ? "VHT80" : "HT20", + }, }, }, }))} From 4368bea2c24bd8e5cac36e22f220fa8cb771ae8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Sa=C5=A1ek?= Date: Thu, 29 Apr 2021 01:26:21 +0200 Subject: [PATCH 2/2] Update tests --- src/common/WiFiSettings/__tests__/WiFiSettings.test.js | 8 ++++---- .../WiFiSettings/__tests__/__fixtures__/wifiSettings.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/WiFiSettings/__tests__/WiFiSettings.test.js b/src/common/WiFiSettings/__tests__/WiFiSettings.test.js index 7f533c2..6dd75d0 100644 --- a/src/common/WiFiSettings/__tests__/WiFiSettings.test.js +++ b/src/common/WiFiSettings/__tests__/WiFiSettings.test.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. @@ -116,7 +116,7 @@ describe("", () => { enabled: true, guest_wifi: { enabled: false }, hidden: false, - htmode: "HT40", + htmode: "HT80", hwmode: "11a", id: 0, password: "TestPass", @@ -145,7 +145,7 @@ describe("", () => { enabled: true, guest_wifi: { enabled: false }, hidden: false, - htmode: "HT40", + htmode: "HT20", hwmode: "11g", id: 0, password: "TestPass", @@ -181,7 +181,7 @@ describe("", () => { password: "test_password", }, hidden: false, - htmode: "HT40", + htmode: "HT80", hwmode: "11a", id: 0, password: "TestPass", diff --git a/src/common/WiFiSettings/__tests__/__fixtures__/wifiSettings.js b/src/common/WiFiSettings/__tests__/__fixtures__/wifiSettings.js index 5b45398..0e9b74f 100644 --- a/src/common/WiFiSettings/__tests__/__fixtures__/wifiSettings.js +++ b/src/common/WiFiSettings/__tests__/__fixtures__/wifiSettings.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) + * Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. @@ -226,7 +226,7 @@ export function wifiSettingsFixture() { password: "", }, hidden: false, - htmode: "HT40", + htmode: "HT80", hwmode: "11a", id: 0, password: "TestPass",