From 9ba7ca38456094e699c885a37e800cbb537ee870 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Wed, 30 Mar 2022 10:53:22 +0200 Subject: [PATCH] feat: hide penMode button on reload if not enabled (#4992) --- src/data/restore.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/restore.ts b/src/data/restore.ts index 97f6f8a6..421223ef 100644 --- a/src/data/restore.ts +++ b/src/data/restore.ts @@ -252,6 +252,10 @@ export const restoreAppState = ( } return { ...nextAppState, + // reset on fresh restore so as to hide the UI button if penMode not active + penDetected: + localAppState?.penDetected ?? + (appState.penMode ? appState.penDetected ?? false : false), activeTool: { lastActiveToolBeforeEraser: null, locked: nextAppState.activeTool.locked ?? false,