Ver Fonte

feat: hide penMode button on reload if not enabled (#4992)

David Luzar há 3 anos atrás
pai
commit
9ba7ca3845
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      src/data/restore.ts

+ 4 - 0
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,