mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-30 00:42:48 -05:00
Rename space -> view
This commit is contained in:
@@ -11,7 +11,7 @@ function App({ wsEndpoint }) {
|
|||||||
const wsRef = useRef()
|
const wsRef = useRef()
|
||||||
const [isConnected, setIsConnected] = useState(false)
|
const [isConnected, setIsConnected] = useState(false)
|
||||||
const [streamData, setStreamData] = useState()
|
const [streamData, setStreamData] = useState()
|
||||||
const [spaceIdxMap, setSpaceIdxMap] = useState(new Map())
|
const [viewIdxMap, setViewIdxMap] = useState(new Map())
|
||||||
const [listeningIdxSet, setListeningIdxSet] = useState(new Set())
|
const [listeningIdxSet, setListeningIdxSet] = useState(new Set())
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -45,7 +45,7 @@ function App({ wsEndpoint }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setSpaceIdxMap(newSpaceIdxMap)
|
setViewIdxMap(newSpaceIdxMap)
|
||||||
setListeningIdxSet(newListeningIdxSet)
|
setListeningIdxSet(newListeningIdxSet)
|
||||||
} else {
|
} else {
|
||||||
console.warn('unexpected ws message', msg)
|
console.warn('unexpected ws message', msg)
|
||||||
@@ -56,7 +56,7 @@ function App({ wsEndpoint }) {
|
|||||||
|
|
||||||
const handleSetSpace = useCallback(
|
const handleSetSpace = useCallback(
|
||||||
(idx, id) => {
|
(idx, id) => {
|
||||||
const newSpaceIdxMap = new Map(spaceIdxMap)
|
const newSpaceIdxMap = new Map(viewIdxMap)
|
||||||
if (id !== undefined) {
|
if (id !== undefined) {
|
||||||
newSpaceIdxMap.set(idx, id)
|
newSpaceIdxMap.set(idx, id)
|
||||||
} else {
|
} else {
|
||||||
@@ -68,7 +68,7 @@ function App({ wsEndpoint }) {
|
|||||||
]).filter(([s, i]) => i)
|
]).filter(([s, i]) => i)
|
||||||
wsRef.current.send(JSON.stringify({ type: 'set-views', views }))
|
wsRef.current.send(JSON.stringify({ type: 'set-views', views }))
|
||||||
},
|
},
|
||||||
[streamData, spaceIdxMap],
|
[streamData, viewIdxMap],
|
||||||
)
|
)
|
||||||
|
|
||||||
const handleSetListening = useCallback((idx, listening) => {
|
const handleSetListening = useCallback((idx, listening) => {
|
||||||
@@ -96,7 +96,7 @@ function App({ wsEndpoint }) {
|
|||||||
<GridInput
|
<GridInput
|
||||||
idx={idx}
|
idx={idx}
|
||||||
onChangeSpace={handleSetSpace}
|
onChangeSpace={handleSetSpace}
|
||||||
spaceValue={spaceIdxMap.get(idx)}
|
spaceValue={viewIdxMap.get(idx)}
|
||||||
isListening={listeningIdxSet.has(idx)}
|
isListening={listeningIdxSet.has(idx)}
|
||||||
onSetListening={handleSetListening}
|
onSetListening={handleSetListening}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user