forked from Shiloh/remnantchat
feat: close peer list when leaving room
This commit is contained in:
parent
2910c70a8a
commit
19e8a3ca04
@ -41,8 +41,14 @@ export function useRoom(
|
||||
)
|
||||
|
||||
const [numberOfPeers, setNumberOfPeers] = useState(1) // Includes this peer
|
||||
const { setDoShowPeers, peerList, setPeerList, tabHasFocus, showAlert } =
|
||||
useContext(ShellContext)
|
||||
const {
|
||||
setDoShowPeers,
|
||||
peerList,
|
||||
setPeerList,
|
||||
tabHasFocus,
|
||||
showAlert,
|
||||
setIsPeerListOpen,
|
||||
} = useContext(ShellContext)
|
||||
const settingsContext = useContext(SettingsContext)
|
||||
const [isMessageSending, setIsMessageSending] = useState(false)
|
||||
const [messageLog, _setMessageLog] = useState<
|
||||
@ -104,8 +110,9 @@ export function useRoom(
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
peerRoom.leaveRoom()
|
||||
setIsPeerListOpen(false)
|
||||
}
|
||||
}, [peerRoom])
|
||||
}, [peerRoom, setIsPeerListOpen])
|
||||
|
||||
useEffect(() => {
|
||||
setDoShowPeers(true)
|
||||
|
Loading…
Reference in New Issue
Block a user