Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix deleting of connection
  • Loading branch information
Benjamin Faal
Benjamin Faal committed Dec 3, 2020
commit b05531334d1d5bc569472794266beec1baf41cc6
3 changes: 2 additions & 1 deletion src/use-peer-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const usePeerState = <TState extends {}>(
setConnections(prevState => {
var indexOfClosedConnection = prevState.findIndex(value => value.peer === conn.peer);
if (indexOfClosedConnection !== -1) {
return prevState.splice(indexOfClosedConnection, 1);
prevState.splice(indexOfClosedConnection, 1);
return [...prevState];
}
return prevState;
})
Expand Down