Skip to content

Commit dea867d

Browse files
committed
log undo/redo
1 parent c05c3e1 commit dea867d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/web/app/History.re

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ module Update = {
5555
| [] =>
5656
print_endline("Cannot undo");
5757
model |> Updated.raise_invalid_action;
58-
| [x, ...rest] => {
58+
| [x, ...rest] =>
59+
Log.Entry.save(Log.Entry.mk(action));
60+
{
5961
...x,
6062
model: {
6163
current: x.model,
@@ -70,14 +72,16 @@ module Update = {
7072
],
7173
replay_toggle: model.replay_toggle,
7274
},
73-
}
75+
};
7476
}
7577
| Globals(Redo) =>
7678
switch (model.redo_stack) {
7779
| [] =>
7880
print_endline("Cannot redo");
7981
model |> Updated.raise_invalid_action;
80-
| [x, ...rest] => {
82+
| [x, ...rest] =>
83+
Log.Entry.save(Log.Entry.mk(action));
84+
{
8185
...x,
8286
model: {
8387
current: x.model,
@@ -92,7 +96,7 @@ module Update = {
9296
redo_stack: rest,
9397
replay_toggle: model.replay_toggle,
9498
},
95-
}
99+
};
96100
}
97101
| Globals(Log(a)) =>
98102
switch (a) {

0 commit comments

Comments
 (0)