diff --git a/src/components/Actions.tsx b/src/components/Actions.tsx index 3ed084b9b..068e8b7fe 100644 --- a/src/components/Actions.tsx +++ b/src/components/Actions.tsx @@ -186,7 +186,6 @@ export const ShapesSwitcher = ({ setAppState, onImageAction, appState, - penDetected, setDeviceType, }: { canvas: HTMLCanvasElement | null; @@ -194,10 +193,9 @@ export const ShapesSwitcher = ({ setAppState: React.Component["setState"]; onImageAction: (data: { pointerType: PointerType | null }) => void; appState: AppState; - penDetected: boolean; setDeviceType: (obj: Partial) => void; }) => { - const pd = useDeviceType().penDetected; + const penDetected = useDeviceType().penDetected; return ( <> {SHAPES.map(({ value, icon, key }, index) => { @@ -220,7 +218,7 @@ export const ShapesSwitcher = ({ aria-keyshortcuts={shortcut} data-testid={value} onChange={({ pointerType }) => { - if (!pd && pointerType === "pen") { + if (!penDetected && pointerType === "pen") { setAppState({ penMode: true }); setDeviceType({ penDetected: true }); } diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index 78be2b99b..d9aa95869 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -360,7 +360,6 @@ const LayerUI = ({ insertOnCanvasDirectly: pointerType !== "mouse", }); }} - penDetected={deviceType.penDetected} setDeviceType={setDeviceType} /> diff --git a/src/components/MobileMenu.tsx b/src/components/MobileMenu.tsx index 691b9fcf4..ddbcf906b 100644 --- a/src/components/MobileMenu.tsx +++ b/src/components/MobileMenu.tsx @@ -85,7 +85,6 @@ export const MobileMenu = ({ insertOnCanvasDirectly: pointerType !== "mouse", }); }} - penDetected={deviceType.penDetected} setDeviceType={setDeviceType} />