From 3ba06013b0a6f28676fde99e488a93a0cfb7ae85 Mon Sep 17 00:00:00 2001 From: grey Date: Thu, 14 Jul 2022 23:12:18 +0200 Subject: [PATCH] - added new relativ add millis --- index.js | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ca6485b..dc89809 100644 --- a/index.js +++ b/index.js @@ -199,6 +199,14 @@ app.get("/api/v1/set/addMillisToTimer", function (req, res) { updatedData() }); +app.get("/api/v1/set/relativAddMillisToTimer", function (req, res) { + currentState.timeAmountInital = req.query.time; + currentState.countdownGoal = currentState.countdownGoal + parseInt(req.query.time) + currentState.pauseMoment = new Date().getTime(); + res.json({ status: "ok" }); + updatedData() +}); + app.get("/api/v1/ctrl/timer/pause", function (req, res) { currentState.timerRunState = false; currentState.pauseMoment = new Date().getTime(); diff --git a/package.json b/package.json index 3f07d89..eaec627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencountdown", - "version": "1.0.1", + "version": "1.0.2", "description": "An opensource countdown", "main": "index.js", "scripts": {