From c76676efc5dc3a7fbfa9fcb11340fa6bcc0a415f Mon Sep 17 00:00:00 2001 From: tuxfoo Date: Tue, 27 Apr 2021 08:06:49 +1200 Subject: [PATCH] Fixed test --- dashboard/panel.html | 2 +- extension/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/panel.html b/dashboard/panel.html index 08aa5fe..e25ab8a 100644 --- a/dashboard/panel.html +++ b/dashboard/panel.html @@ -175,7 +175,7 @@ }); document.getElementById('testBtn').addEventListener('click', e => { - test.value = document.getElementById('testInput').value; + test.value = { amount: document.getElementById('testInput').value, change: test.value.change + 1 }; }); document.getElementById('defaultBtn').addEventListener('click', e => { diff --git a/extension/index.js b/extension/index.js index cb60228..55fec61 100644 --- a/extension/index.js +++ b/extension/index.js @@ -6,7 +6,7 @@ module.exports = function (nodecg) { nodecg.Replicant('claim_id', { defaultValue: "Place claim id of your livestream here", persistent: true }); nodecg.Replicant('defaultTrigger', { defaultValue: "Alert1" }); nodecg.Replicant('triggers', { defaultValue: [{name: 'Alert1', amount: '', type: "greaterthan" }] }); - nodecg.Replicant('test', { defaultValue: 0, persistent: false }); + nodecg.Replicant('test', { defaultValue: { amount: 0, change: 0 }, persistent: false }); const claim_id = nodecg.Replicant('claim_id'); const defaultTrigger = nodecg.Replicant('defaultTrigger'); @@ -62,8 +62,8 @@ module.exports = function (nodecg) { test.on('change', value => { var alertName = defaultTrigger.value; - alertName = checkTriggers(value, alertName); - activateAlert(alertName, "Slyver Testallone", value); + alertName = checkTriggers(value.amount, alertName); + activateAlert(alertName, "Slyver Testallone", value.amount); }); // Connection opened