From c055a07f45c7a714147bff01bd7e83d389a248cd Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 28 Dec 2019 23:08:46 +0200 Subject: [PATCH] Switch default ports when toggling TLS --- client/components/NetworkForm.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/components/NetworkForm.vue b/client/components/NetworkForm.vue index 58c6f80e..59a6e464 100644 --- a/client/components/NetworkForm.vue +++ b/client/components/NetworkForm.vue @@ -45,6 +45,7 @@ : Use secure connection (TLS) @@ -194,6 +196,16 @@ export default { this.previousUsername = event.target.value; }, + onSecureChanged(event) { + const ports = ["6667", "6697"]; + const newPort = event.target.checked ? 0 : 1; + + // If you disable TLS and current port is 6697, + // set it to 6667, and vice versa + if (this.$refs.serverPort.value === ports[newPort]) { + this.$refs.serverPort.value = ports[1 - newPort]; + } + }, onSubmit(event) { const formData = new FormData(event.target); const data = {};