Review fixes

This commit is contained in:
Marcel Mraz 2025-04-30 13:51:30 +02:00
parent e8898b4429
commit df79ceae4e
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
4 changed files with 3 additions and 7 deletions

View file

@ -529,11 +529,11 @@ export class StoreDelta {
delta: StoreDelta,
elements: SceneElementsMap,
appState: AppState,
snapshot: StoreSnapshot = StoreSnapshot.empty(),
prevSnapshot: StoreSnapshot = StoreSnapshot.empty(),
): [SceneElementsMap, AppState, boolean] {
const [nextElements, elementsContainVisibleChange] = delta.elements.applyTo(
elements,
snapshot.elements,
prevSnapshot.elements,
);
const [nextAppState, appStateContainsVisibleChange] =

View file

@ -778,7 +778,6 @@ class App extends React.Component<AppProps, AppState> {
addFiles: this.addFiles,
resetScene: this.resetScene,
getSceneElementsIncludingDeleted: this.getSceneElementsIncludingDeleted,
store: this.store,
history: {
clear: this.resetHistory,
},

View file

@ -106,7 +106,6 @@ export class History {
// iterate through the history entries in case they result in no visible changes
while (historyEntry) {
try {
// creating iteration-scoped variables, so that we can use them in the unstable_scheduleCallback
[nextElements, nextAppState, containsVisibleChange] =
StoreDelta.applyTo(
historyEntry,
@ -120,8 +119,7 @@ export class History {
CaptureUpdateAction.IMMEDIATELY,
nextElements,
nextAppState,
// create a new instance of the history entry, so that it's not mutated in the meantime
HistoryEntry.restore(historyEntry),
historyEntry,
);
} finally {
// make sure to always push, even if the delta is corrupted

View file

@ -800,7 +800,6 @@ export interface ExcalidrawImperativeAPI {
history: {
clear: InstanceType<typeof App>["resetHistory"];
};
store: InstanceType<typeof App>["store"];
getSceneElements: InstanceType<typeof App>["getSceneElements"];
getAppState: () => InstanceType<typeof App>["state"];
getFiles: () => InstanceType<typeof App>["files"];