Default downPriority to priority+1 with a max of 5 where not set

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Andrea Mastellone 2025-06-09 18:32:19 -04:00 committed by GitHub
parent 8cae54c559
commit 6f63175244
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,8 @@ class Ntfy extends NotificationProvider {
let tags = [];
let status = "unknown";
let priority = notification.ntfyPriority || 4;
let downPriority = notification.ntfyPriorityDown || 5;
// defaults to max(priority + 1, 5)
let downPriority = notification.ntfyPriorityDown || (priority === 5 ? priority : priority + 1);
if ("status" in heartbeatJSON) {
if (heartbeatJSON.status === DOWN) {
tags = [ "red_circle" ];