I think I found the solution here:
pay attention to the “reset” and the “$prevNode.name === “if”” part.
Worked for me! Hope that helps you