Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit 9b25bc7

Browse files
committed
feat(editor): supporting time-traveling
1 parent d26e34b commit 9b25bc7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

β€Žpackages/editor/src/libs/history/configure.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { TimeTravelerConfig } from './types';
22

33
export const config: TimeTravelerConfig = {
4-
maxStacks: 20,
4+
maxStacks: 50,
55
debounceTime: 2000,
66
};
77

β€Žpackages/editor/src/libs/history/timeTraveling.tsβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export class TimeTraveler {
5050
stacks.push(boxedItem);
5151
}
5252

53+
if (stacks.length > config.maxStacks) {
54+
stacks.splice(0, config.maxStacks - stacks.length - 1);
55+
}
56+
5357
this.cursor = stacks.length - 1;
5458
this.lastUpdate = Date.now();
5559
};

0 commit comments

Comments
Β (0)