Skip to content

Commit

Permalink
close faye connection on app unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
mahboubii committed Apr 8, 2021
1 parent 7bfa7f1 commit b0c480a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Context/StreamApp.js
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 b0c480a

Please sign in to comment.