MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / revert

Method revert

src/actions/HideVideo.ts:73–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 }
72
73 override async revert(): Promise<void> {
74 const history = this.engine.history('video') as string[];
75 for (let i = history.length - 1; i >= 0; i--) {
76 const last = history[i];
77 const [, , name] = last.split(' ');
78 if (name === this.name) {
79 const action = this.engine.prepareAction(last, { cycle: 'Application' }) as ActionInstance | null;
80 if (action !== null) {
81 await action.willApply();
82 await action.apply();
83 await action.didApply({ updateHistory: false, updateState: true });
84 }
85 return;
86 }
87 }
88 }
89
90 override async didRevert(): Promise<ActionRevertResult> {
91 return { advance: true, step: true };

Callers

nothing calls this directly

Calls 5

historyMethod · 0.80
prepareActionMethod · 0.80
willApplyMethod · 0.45
applyMethod · 0.45
didApplyMethod · 0.45

Tested by

no test coverage detected