Fix clicking stream ids copying when no empty space

This commit is contained in:
Max Goodhart
2020-07-06 17:49:40 -07:00
parent b229930aa1
commit 5b1899901a

View File

@@ -282,6 +282,7 @@ function App({ wsEndpoint }) {
const handleClickId = useCallback( const handleClickId = useCallback(
(streamId) => { (streamId) => {
navigator.clipboard.writeText(streamId)
const availableIdx = range(gridCount * gridCount).find( const availableIdx = range(gridCount * gridCount).find(
(i) => !sharedState.views[i].streamId, (i) => !sharedState.views[i].streamId,
) )
@@ -289,7 +290,6 @@ function App({ wsEndpoint }) {
return return
} }
handleSetView(availableIdx, streamId) handleSetView(availableIdx, streamId)
navigator.clipboard.writeText(streamId)
}, },
[gridCount, sharedState], [gridCount, sharedState],
) )