Only show cursor chat button in select mode (#3485)

This PR hides the cursor chat context menu button when not in select
tool.

fixes
https://github.com/orgs/tldraw/projects/41/views/1?pane=issue&itemId=59908615

### Change Type

<!--  Please select a 'Scope' label ️ -->

- [ ] `sdk` — Changes the tldraw SDK
- [x] `dotcom` — Changes the tldraw.com web app
- [ ] `docs` — Changes to the documentation, examples, or templates.
- [ ] `vs code` — Changes to the vscode plugin
- [ ] `internal` — Does not affect user-facing stuff

<!--  Please select a 'Type' label ️ -->

- [x] `bugfix` — Bug fix
- [ ] `feature` — New feature
- [ ] `improvement` — Improving existing features
- [ ] `chore` — Updating dependencies, other boring stuff
- [ ] `galaxy brain` — Architectural changes
- [ ] `tests` — Changes to any test code
- [ ] `tools` — Changes to infrastructure, CI, internal scripts,
debugging tools, etc.
- [ ] `dunno` — I don't know


### Test Plan

1. Add a step-by-step description of how to test your PR here.
2.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Fix cursor chat button appearing when not in select tool.
This commit is contained in:
Lu Wilson 2024-04-16 13:42:26 +01:00 committed by GitHub
parent c7cb91d7d4
commit 8778629f62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,9 +6,7 @@ export function CursorChatMenuItem() {
const actions = useActions() const actions = useActions()
const shouldShow = useValue( const shouldShow = useValue(
'show cursor chat', 'show cursor chat',
() => { () => editor.getCurrentToolId() === 'select' && !editor.getInstanceState().isCoarsePointer,
return !editor.getInstanceState().isCoarsePointer
},
[editor] [editor]
) )