Skip to content

OpenReel Video - Professional browser-based video editor. Open source CapCut alternative. 100% browser-based, no installation, no cloud uploads, no watermarks.

TypeScript
427 B
Raw Blame
import type { ProjectState } from "../../stores/project-store";

export function aiUndoCheckpoint(state: Pick<ProjectState, "actionExecutor" | "clipUndoStack" | "templateUndoStack">) {
  const history = state.actionExecutor.getHistory();
  return {
    size: history.getUndoStackSize() + (state.clipUndoStack?.length ?? 0) + (state.templateUndoStack?.length ?? 0),
    actionId: history.peekUndo?.()?.action.id ?? null,
  };
}