From 6c4afdeb6f2cc8b194ccfba097a5370e8c878ac2 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Thu, 30 Apr 2020 21:02:27 +0100 Subject: [PATCH] Clean up var declaration --- src/nginxconfig/templates/domain_sections/php.vue | 3 +-- src/nginxconfig/templates/domain_sections/python.vue | 3 +-- src/nginxconfig/templates/domain_sections/reverse_proxy.vue | 3 +-- src/nginxconfig/templates/domain_sections/routing.vue | 3 +-- src/nginxconfig/templates/domain_sections/server.vue | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/nginxconfig/templates/domain_sections/php.vue b/src/nginxconfig/templates/domain_sections/php.vue index e171869..746f8f7 100644 --- a/src/nginxconfig/templates/domain_sections/php.vue +++ b/src/nginxconfig/templates/domain_sections/php.vue @@ -155,8 +155,7 @@ // Disable everything if PHP is disabled '$props.data.php': { handler(data) { - const state = data.computed; - if (state) { + if (data.computed) { this.$props.data.wordPressRules.enabled = true; this.$props.data.wordPressRules.computed = this.$props.data.wordPressRules.value; this.$props.data.drupalRules.enabled = true; diff --git a/src/nginxconfig/templates/domain_sections/python.vue b/src/nginxconfig/templates/domain_sections/python.vue index a7280f5..47b32e6 100644 --- a/src/nginxconfig/templates/domain_sections/python.vue +++ b/src/nginxconfig/templates/domain_sections/python.vue @@ -111,8 +111,7 @@ // Disable Django if Python is disabled '$props.data.python': { handler(data) { - const state = data.computed; - if (state) { + if (data.computed) { this.$props.data.djangoRules.enabled = true; this.$props.data.djangoRules.computed = this.$props.data.djangoRules.value; } else { diff --git a/src/nginxconfig/templates/domain_sections/reverse_proxy.vue b/src/nginxconfig/templates/domain_sections/reverse_proxy.vue index c9cdb42..5509b76 100644 --- a/src/nginxconfig/templates/domain_sections/reverse_proxy.vue +++ b/src/nginxconfig/templates/domain_sections/reverse_proxy.vue @@ -131,8 +131,7 @@ // Disable all options if Reverse proxy is disabled '$props.data.reverseProxy': { handler(data) { - const state = data.computed; - if (state) { + if (data.computed) { this.$props.data.path.enabled = true; this.$props.data.path.computed = this.$props.data.path.value; this.$props.data.proxyPass.enabled = true; diff --git a/src/nginxconfig/templates/domain_sections/routing.vue b/src/nginxconfig/templates/domain_sections/routing.vue index 5f3f3d7..6e84825 100644 --- a/src/nginxconfig/templates/domain_sections/routing.vue +++ b/src/nginxconfig/templates/domain_sections/routing.vue @@ -158,8 +158,7 @@ // Disable all options (expect legacy php) if root is disabled '$props.data.root': { handler(data) { - const state = data.computed; - if (state) { + if (data.computed) { this.$props.data.index.enabled = true; this.$props.data.index.computed = this.$props.data.index.value; this.$props.data.fallbackHtml.enabled = true; diff --git a/src/nginxconfig/templates/domain_sections/server.vue b/src/nginxconfig/templates/domain_sections/server.vue index de831f0..2272c70 100644 --- a/src/nginxconfig/templates/domain_sections/server.vue +++ b/src/nginxconfig/templates/domain_sections/server.vue @@ -188,8 +188,7 @@ '$props.data.wwwSubdomain': { handler(data) { // This might cause recursion, but seems not to - const state = data.computed; - if (state) { + if (data.computed) { this.$props.data.cdnSubdomain.enabled = true; this.$props.data.cdnSubdomain.computed = this.$props.data.cdnSubdomain.value; } else {