From d764e80068f66c2b6a0989c7a748147b0055adaf Mon Sep 17 00:00:00 2001 From: Computroniks Date: Sat, 29 Jan 2022 21:29:52 +0000 Subject: [PATCH] Cleaned up name selection and friendlyNameRequired Signed-off-by: Computroniks --- src/pages/EditMonitor.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 4deef120b..796a7437b 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -497,13 +497,7 @@ export default { // Check if friendly name has been supplied. If not, use URL // or hostname - if (this.monitor.name === "") { - if (this.monitor.hostname === null || this.monitor.hostname === "") { - this.monitor.name = this.monitor.url; - } else { - this.monitor.name = this.monitor.hostname; - } - } + this.monitor.name = this.monitor.name || this.monitor.hostname || this.monitor.url; if (!this.isInputValid()) { this.processing = false; @@ -554,14 +548,14 @@ export default { /** * Is the friendly name required for the selected option. - * Returns true if it is else null - * @returns {null|true} + * Returns true if it is else false + * @returns {boolean} */ friendlyNameRequired() { if (this.friendlyNameRequiredOptions.includes(this.monitor.type)) { return true; } else { - return null; + return false; } } },