Don't allow g keyboard shortcut in readonly mode, show laser tool in the toolbar (#1459)

Disable `g` keyboard shortcut in readonly mode. Show laser tool in
toolbar when in readonly mode.

Resolves [#1936](https://github.com/tldraw/brivate/issues/1936)
Resolves [#1935](https://github.com/tldraw/brivate/issues/1935)

### Change Type

- [x] `patch` — Bug Fix

### Test Plan

1. Open a readonly room.
2. Press `g` and make sure it doesn't switch to it.
3. Laser tool should be visible in the toolbar in readonly rooms.


### Release Notes

- Disable geo tool shortcut in readonly mode. Show laser on the toolbar.

---------

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
Mitja Bezenšek 2023-05-25 21:08:52 +02:00 committed by GitHub
parent d22542bc55
commit 042edeb4b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 2 deletions

View file

@ -479,7 +479,9 @@ async function handleClipboardThings(app: App, things: ClipboardThing[], point?:
const handleNativeOrMenuCopy = (app: App) => {
const content = app.getContent()
if (!content) {
window.navigator.clipboard.writeText('')
if (navigator && navigator.clipboard) {
navigator.clipboard.writeText('')
}
return
}