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,
|
delta: StoreDelta,
|
||||||
elements: SceneElementsMap,
|
elements: SceneElementsMap,
|
||||||
appState: AppState,
|
appState: AppState,
|
||||||
snapshot: StoreSnapshot = StoreSnapshot.empty(),
|
prevSnapshot: StoreSnapshot = StoreSnapshot.empty(),
|
||||||
): [SceneElementsMap, AppState, boolean] {
|
): [SceneElementsMap, AppState, boolean] {
|
||||||
const [nextElements, elementsContainVisibleChange] = delta.elements.applyTo(
|
const [nextElements, elementsContainVisibleChange] = delta.elements.applyTo(
|
||||||
elements,
|
elements,
|
||||||
snapshot.elements,
|
prevSnapshot.elements,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [nextAppState, appStateContainsVisibleChange] =
|
const [nextAppState, appStateContainsVisibleChange] =
|
||||||
|
|
|
@ -778,7 +778,6 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
addFiles: this.addFiles,
|
addFiles: this.addFiles,
|
||||||
resetScene: this.resetScene,
|
resetScene: this.resetScene,
|
||||||
getSceneElementsIncludingDeleted: this.getSceneElementsIncludingDeleted,
|
getSceneElementsIncludingDeleted: this.getSceneElementsIncludingDeleted,
|
||||||
store: this.store,
|
|
||||||
history: {
|
history: {
|
||||||
clear: this.resetHistory,
|
clear: this.resetHistory,
|
||||||
},
|
},
|
||||||
|
|
|
@ -106,7 +106,6 @@ export class History {
|
||||||
// iterate through the history entries in case they result in no visible changes
|
// iterate through the history entries in case they result in no visible changes
|
||||||
while (historyEntry) {
|
while (historyEntry) {
|
||||||
try {
|
try {
|
||||||
// creating iteration-scoped variables, so that we can use them in the unstable_scheduleCallback
|
|
||||||
[nextElements, nextAppState, containsVisibleChange] =
|
[nextElements, nextAppState, containsVisibleChange] =
|
||||||
StoreDelta.applyTo(
|
StoreDelta.applyTo(
|
||||||
historyEntry,
|
historyEntry,
|
||||||
|
@ -120,8 +119,7 @@ export class History {
|
||||||
CaptureUpdateAction.IMMEDIATELY,
|
CaptureUpdateAction.IMMEDIATELY,
|
||||||
nextElements,
|
nextElements,
|
||||||
nextAppState,
|
nextAppState,
|
||||||
// create a new instance of the history entry, so that it's not mutated in the meantime
|
historyEntry,
|
||||||
HistoryEntry.restore(historyEntry),
|
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
// make sure to always push, even if the delta is corrupted
|
// make sure to always push, even if the delta is corrupted
|
||||||
|
|
|
@ -800,7 +800,6 @@ export interface ExcalidrawImperativeAPI {
|
||||||
history: {
|
history: {
|
||||||
clear: InstanceType<typeof App>["resetHistory"];
|
clear: InstanceType<typeof App>["resetHistory"];
|
||||||
};
|
};
|
||||||
store: InstanceType<typeof App>["store"];
|
|
||||||
getSceneElements: InstanceType<typeof App>["getSceneElements"];
|
getSceneElements: InstanceType<typeof App>["getSceneElements"];
|
||||||
getAppState: () => InstanceType<typeof App>["state"];
|
getAppState: () => InstanceType<typeof App>["state"];
|
||||||
getFiles: () => InstanceType<typeof App>["files"];
|
getFiles: () => InstanceType<typeof App>["files"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue