chore: Remove references to window.Sentry
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
import * as Sentry from "@sentry/react";
|
||||||
import { observable } from "mobx";
|
import { observable } from "mobx";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
@ -36,8 +37,8 @@ class ErrorBoundary extends React.Component<Props> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.Sentry) {
|
if (env.SENTRY_DSN) {
|
||||||
window.Sentry.captureException(error);
|
Sentry.captureException(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ class ErrorBoundary extends React.Component<Props> {
|
|||||||
render() {
|
render() {
|
||||||
if (this.error) {
|
if (this.error) {
|
||||||
const error = this.error;
|
const error = this.error;
|
||||||
const isReported = !!window.Sentry && env.DEPLOYMENT === "hosted";
|
const isReported = !!env.SENTRY_DSN && env.DEPLOYMENT === "hosted";
|
||||||
const isChunkError = this.error.message.match(/chunk/);
|
const isChunkError = this.error.message.match(/chunk/);
|
||||||
|
|
||||||
if (isChunkError) {
|
if (isChunkError) {
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
// @flow
|
// @flow
|
||||||
|
import * as Sentry from "@sentry/react";
|
||||||
import invariant from "invariant";
|
import invariant from "invariant";
|
||||||
import { observable, action, computed, autorun, runInAction } from "mobx";
|
import { observable, action, computed, autorun, runInAction } from "mobx";
|
||||||
import { getCookie, setCookie, removeCookie } from "tiny-cookie";
|
import { getCookie, setCookie, removeCookie } from "tiny-cookie";
|
||||||
import RootStore from "stores/RootStore";
|
import RootStore from "stores/RootStore";
|
||||||
import Team from "models/Team";
|
import Team from "models/Team";
|
||||||
import User from "models/User";
|
import User from "models/User";
|
||||||
|
import env from "env";
|
||||||
import { client } from "utils/ApiClient";
|
import { client } from "utils/ApiClient";
|
||||||
import { getCookieDomain } from "utils/domains";
|
import { getCookieDomain } from "utils/domains";
|
||||||
|
|
||||||
@ -125,8 +127,8 @@ export default class AuthStore {
|
|||||||
this.user = new User(user);
|
this.user = new User(user);
|
||||||
this.team = new Team(team);
|
this.team = new Team(team);
|
||||||
|
|
||||||
if (window.Sentry) {
|
if (env.SENTRY_DSN) {
|
||||||
window.Sentry.configureScope(function (scope) {
|
Sentry.configureScope(function (scope) {
|
||||||
scope.setUser({ id: user.id });
|
scope.setUser({ id: user.id });
|
||||||
scope.setExtra("team", team.name);
|
scope.setExtra("team", team.name);
|
||||||
scope.setExtra("teamId", team.id);
|
scope.setExtra("teamId", team.id);
|
||||||
|
Reference in New Issue
Block a user