Skip to content

Commit

Permalink
Fix usage with storybook (#4)
Browse files Browse the repository at this point in the history
* Fix storybook

* fix(sentry): check if typeof sentry isn't undefined

Co-authored-by: David Ichim <ichim.david@gmail.com>
  • Loading branch information
avoinea and ichim-david committed Nov 22, 2022
1 parent 5a89e8b commit b0ea762
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ const applyConfig = (config) => {
apply();
}

if ((__CLIENT__ && window?.env?.RAZZLE_SENTRY_DSN) || __SENTRY__?.SENTRY_DSN)
if (__CLIENT__ && window?.env?.RAZZLE_SENTRY_DSN) {
loadSentry();
}

// check if we have __SENTRY__ otherwise we break storybook
if (typeof __SENTRY__ !== 'undefined' && __SENTRY__.SENTRY_DSN) {
loadSentry();
}

return config;
};
Expand Down

0 comments on commit b0ea762

Please sign in to comment.