mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: decouple actionFinalize and actionErase (#4984)
* Update actionCanvas.tsx * Update actionFinalize.tsx * lint * remove Escape trigger from actionErase * revert to lastActiveTool only if coming from eraser tool * unrelated: fix restoring `appState.activeTool` * one more restoring fix * fix tests Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
f2d2f97546
commit
734bb4d2ed
4 changed files with 22 additions and 16 deletions
|
@ -252,9 +252,13 @@ export const restoreAppState = (
|
|||
}
|
||||
return {
|
||||
...nextAppState,
|
||||
activeTool: AllowedExcalidrawActiveTools[nextAppState.activeTool.type]
|
||||
? nextAppState.activeTool
|
||||
: { ...nextAppState.activeTool, type: "selection" },
|
||||
activeTool: {
|
||||
lastActiveToolBeforeEraser: null,
|
||||
locked: nextAppState.activeTool.locked ?? false,
|
||||
type: AllowedExcalidrawActiveTools[nextAppState.activeTool.type]
|
||||
? nextAppState.activeTool.type ?? "selection"
|
||||
: "selection",
|
||||
},
|
||||
// Migrates from previous version where appState.zoom was a number
|
||||
zoom:
|
||||
typeof appState.zoom === "number"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue