Skip to content

Commit

Permalink
[blockly] Fix timer remove regression (#2032)
Browse files Browse the repository at this point in the history
Fixes #2002.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
  • Loading branch information
stefan-hoehn authored Aug 29, 2023
1 parent 312aa0e commit 9e9caba
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export default function defineOHBlocks_Timers (f7, isGraalJs) {
let code = `if (cache.${cacheType}.exists(${timerName}) === false || cache.${cacheType}.get(${timerName}).hasTerminated()) {\n`
code += ` cache.${cacheType}.put(${timerName}, actions.ScriptExecution.createTimer(${timerName}, time.ZonedDateTime.now().${delayUnits}(${delay}), function () {\n`
code += timerCode.replace(/^/gm, ' ')
code += ` cache.${cacheType}.remove(${timerName});\n`
code += ' }));\n'
code += '};\n'
return code
Expand Down Expand Up @@ -157,7 +156,6 @@ export default function defineOHBlocks_Timers (f7, isGraalJs) {
let code = `if (cache.${cacheType}.exists(${timerName}) === false || cache.${cacheType}.get(${timerName}).hasTerminated()) {\n`
code += ` cache.${cacheType}.put(${timerName}, actions.ScriptExecution.createTimer(${timerName}, time.ZonedDateTime.now().${delayUnits}(${delay}), function () {\n`
code += timerCode.replace(/^/gm, ' ')
code += ` cache.${cacheType}.remove(${timerName});\n`
code += ' }));\n'
code += '} else {\n'
switch (retrigger) {
Expand Down

0 comments on commit 9e9caba

Please sign in to comment.