diff --git a/src/components/Board.tsx b/src/components/Board.tsx index ec4e29e..e514871 100644 --- a/src/components/Board.tsx +++ b/src/components/Board.tsx @@ -95,6 +95,7 @@ export function Board() { onSelect: () => { if (editor.getSelectedShapeIds().length > 0) { zoomToSelection(editor); + editor.setCurrentTool('hand'); } }, readonlyOk: true, @@ -110,6 +111,7 @@ export function Board() { url.searchParams.set('y', camera.y.toString()); url.searchParams.set('zoom', camera.z.toString()); navigator.clipboard.writeText(url.toString()); + editor.setCurrentTool('hand'); }, readonlyOk: true, }, @@ -119,6 +121,7 @@ export function Board() { kbd: 'b', onSelect: () => { revertCamera(); + editor.setCurrentTool('hand'); }, readonlyOk: true, }, diff --git a/src/ui-overrides.tsx b/src/ui-overrides.tsx index 6e6a6c1..1dfb822 100644 --- a/src/ui-overrides.tsx +++ b/src/ui-overrides.tsx @@ -310,8 +310,9 @@ export const uiOverrides: TLUiOverrides = { label: 'Revert Camera', kbd: 'b', onSelect: () => { - console.log('Reverting camera position'); - revertCamera(editor); + if (cameraHistory.length > 0) { + revertCamera(editor); + } }, readonlyOk: true, } @@ -387,8 +388,11 @@ export const components: TLComponents = { label="Revert Camera" icon="undo" kbd="b" - disabled={!hasCameraHistory} - onSelect={() => revertCamera(editor)} + onSelect={() => { + if (hasCameraHistory) { + revertCamera(editor); + } + }} /> {/* Shape Creation Tools */} @@ -419,25 +423,6 @@ export const components: TLComponents = { editor.setCurrentTool('Embed'); }} /> - - Frame-specific actions - {isFrame && ( - <> - copyFrameLink(editor, selectedShape.id)} - /> - zoomToSelection(editor)} - /> - - )} - ) },