Skip to content
This repository has been archived by the owner on Nov 12, 2020. It is now read-only.

Commit

Permalink
adding try/catch to omit erros on SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
elitan committed Aug 23, 2020
1 parent 35e88c2 commit 5cd0687
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ export class NhostApolloProvider extends React.Component {
if (this.props.auth) {
this.props.auth.onAuthStateChanged((data) => {
// close previous subscription
this.wsLink.subscriptionClient.close(true, true);
try {
this.wsLink.subscriptionClient.close(true, true);
} catch (error) {
// noop. Probably not in a browser
}

// generate new apolloClient with the new logged in state
const { client, wsLink } = generateApolloClient(auth, gql_endpoint);
Expand Down

0 comments on commit 5cd0687

Please sign in to comment.