From 04b55cd89ac7e84db8a5ac018857e194b39ee0f2 Mon Sep 17 00:00:00 2001 From: NihadBadalov <32594553+NihadBadalov@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:00:48 +0100 Subject: [PATCH] Fix: Don't add `Service URL` Disord embed field if empty --- server/notification-providers/discord.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index f24cd616..bc811d87 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -58,10 +58,10 @@ class Discord extends NotificationProvider { name: "Service Name", value: monitorJSON["name"], }, - { + ...((monitorJSON["type"] === "push" || address !== "https://") ? [{ name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", value: monitorJSON["type"] === "push" ? "Heartbeat" : address, - }, + }] : []), { name: `Time (${heartbeatJSON["timezone"]})`, value: heartbeatJSON["localDateTime"], @@ -93,10 +93,10 @@ class Discord extends NotificationProvider { name: "Service Name", value: monitorJSON["name"], }, - { + ...(monitorJSON["type"] === "push" || address !== "https://") ? [{ name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", value: monitorJSON["type"] === "push" ? "Heartbeat" : address, - }, + }] : [], { name: `Time (${heartbeatJSON["timezone"]})`, value: heartbeatJSON["localDateTime"],