feat: feature/mvp-sprint-1

This commit is contained in:
Nikolaj Frey 2023-08-15 11:16:53 +10:00
parent 83da88ac54
commit a19a10a309
2 changed files with 3 additions and 0 deletions

View File

@ -316,6 +316,7 @@ export const Commander = (props) => {
// likely literaly javascript wasn't valid
try {
const fn = `() => { return ${escapedCommandValue} }`
const tt = thingtime
const evalFn = eval(fn)
const realVal = evalFn()
const prevVal = getThingtime(commandPath)

View File

@ -279,6 +279,7 @@ export const CommanderV1 = (props) => {
try {
// first try to execute literal javscript
const fn = `() => { return ${commandValue} }`
const tt = thingtime
const evalFn = eval(fn)
const realVal = evalFn()
setThingtime(commandPath, realVal)
@ -291,6 +292,7 @@ export const CommanderV1 = (props) => {
// likely literaly javascript wasn't valid
try {
const fn = `() => { return ${escapedCommandValue} }`
const tt = thingtime
const evalFn = eval(fn)
const realVal = evalFn()
const prevVal = getThingtime(commandPath)