Skip to content

Commit

Permalink
Merge pull request #176 from GetStream/close-faye-on-unmount
Browse files Browse the repository at this point in the history
close faye connection on app unmount
  • Loading branch information
vishalnarkhede authored Apr 9, 2021
2 parents 7bfa7f1 + b0c480a commit 99bcd2c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Context/StreamApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ export class StreamApp extends React.Component {
this.setState({ t, tDateTimeParser });
}

componentWillUnmount() {
const client = this.state.client;
if (client && client.fayeClient) {
client.fayeClient.disconnect();
}
}

render() {
if (!this.state.t) return null;

Expand Down

0 comments on commit 99bcd2c

Please sign in to comment.