Fix missing closing tag in nightscout plugin and reduce svg size

This commit is contained in:
lowlighter
2021-03-04 21:03:24 +01:00
parent f6006e4e89
commit 9e9b066be9
3 changed files with 43 additions and 44 deletions

View File

@@ -6,10 +6,10 @@
if ((!enabled)||(!q.nightscout))
return null
//Load inputs
//Load inputs
let {url, datapoints, lowalert, highalert, urgentlowalert, urgenthighalert} = imports.metadata.plugins.nightscout.inputs({data, account, q})
if (!url || url === "https://example.herokuapp.com") throw "Nightscout site URL isn't set!"
if (!url || url === "https://example.herokuapp.com") throw {error:{message:"Nightscout site URL isn't set!"}}
if (url.substring(url.length - 1) !== "/") url += "/"
if (url.substring(0, 7) === "http://") url = `https://${url.substring(7)}`
if (url.substring(0, 8) !== "https://") url = `https://${url}`
@@ -43,6 +43,8 @@
}
//Handle errors
catch (error) {
if (error.error?.message)
throw error
throw {error:{message:"An error occured", instance:error}}
}
}