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:
zsviczian 2022-03-29 21:37:09 +02:00 committed by GitHub
parent f2d2f97546
commit 734bb4d2ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 16 deletions

View file

@ -310,7 +310,9 @@ describe("restoreAppState", () => {
stubImportedAppState,
stubLocalAppState,
);
expect(restoredAppState.activeTool).toBe(stubImportedAppState.activeTool);
expect(restoredAppState.activeTool).toEqual(
stubImportedAppState.activeTool,
);
expect(restoredAppState.cursorButton).toBe(
stubImportedAppState.cursorButton,
);