@@ -15,15 +15,17 @@ class ProgramModel(
1515 var currentSelectedFunctionId : String = MainFunId
1616 var currentSelectedStmtId : Option [String ] = None
1717
18- def incrRevision (): Unit =
18+ private def incrRevision (): Unit =
1919 ast = ast.copy(revision = ast.revision + 1 )
2020
2121 def setName (name : String ): Unit =
2222 ast = ast.copy(name = name)
23+ incrRevision()
2324 flowrunChannel := FlowRun .Event .FunctionUpdated
2425
2526 def setConfig (config : FlowRunConfig ): Unit =
2627 ast = ast.copy(config = config)
28+ incrRevision()
2729 flowrunChannel := FlowRun .Event .ConfigChanged
2830
2931 def currentFunction : Function =
@@ -34,6 +36,7 @@ class ProgramModel(
3436 val newFunctions = ast.functions.appended(fun)
3537 ast = ast.copy(functions = newFunctions)
3638 currentSelectedFunctionId = fun.id
39+ incrRevision()
3740 flowrunChannel := FlowRun .Event .Deselected
3841 flowrunChannel := FlowRun .Event .FunctionUpdated
3942
@@ -55,6 +58,7 @@ class ProgramModel(
5558 val newFunctions = ast.functions.filterNot(_.id == id)
5659 ast = ast.copy(functions = newFunctions)
5760 currentSelectedFunctionId = MainFunId
61+ incrRevision()
5862 flowrunChannel := FlowRun .Event .Deselected
5963 flowrunChannel := FlowRun .Event .FunctionUpdated
6064
@@ -76,6 +80,7 @@ class ProgramModel(
7680 else f
7781 }
7882 ast = ast.copy(functions = newFunctions)
83+ incrRevision()
7984 flowrunChannel := FlowRun .Event .FunctionUpdated
8085
8186 /* per-function */
@@ -102,7 +107,7 @@ class ProgramModel(
102107 val newFunctions = ast.functions.updated(idx, newFunction)
103108 ast = ast.copy(functions = newFunctions)
104109 }
105-
110+ incrRevision()
106111 flowrunChannel := evt
107112 }
108113}
0 commit comments