Fix issues uncovered where clones were triggering automatically on create.

This commit is contained in:
Karishma Chadha 2018-12-12 13:25:19 -05:00
parent 6c4fb29523
commit e5b00dfd95
3 changed files with 10 additions and 2 deletions
src/engine

View file

@ -63,11 +63,13 @@ const handleReport = function (resolvedValue, sequencer, thread, blockCached, la
// true and used to be false, or the stack was activated explicitly
// via stack click
if (!thread.stackClick) {
const hasOldEdgeValue = thread.target.hasEdgeActivatedValue(currentBlockId);
const oldEdgeValue = thread.target.updateEdgeActivatedValue(
currentBlockId,
resolvedValue
);
const edgeWasActivated = !oldEdgeValue && resolvedValue;
const edgeWasActivated = hasOldEdgeValue ? (!oldEdgeValue && resolvedValue) : resolvedValue;
if (!edgeWasActivated) {
sequencer.retireThread(thread);
}