mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Review fixes
This commit is contained in:
parent
e8898b4429
commit
df79ceae4e
4 changed files with 3 additions and 7 deletions
|
@ -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] =
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue