|
@@ -25,12 +25,16 @@ if (
|
25
|
25
|
|
26
|
26
|
const SentryEnvHostnameMap: { [key: string]: string } = {
|
27
|
27
|
"excalidraw.com": "production",
|
28
|
|
- "now.sh": "staging",
|
|
28
|
+ "vercel.app": "staging",
|
29
|
29
|
};
|
30
|
30
|
|
|
31
|
+const REACT_APP_DISABLE_SENTRY =
|
|
32
|
+ process.env.REACT_APP_DISABLE_SENTRY === "true";
|
|
33
|
+const REACT_APP_GIT_SHA = process.env.REACT_APP_GIT_SHA as string;
|
|
34
|
+
|
31
|
35
|
// Disable Sentry locally or inside the Docker to avoid noise/respect privacy
|
32
|
36
|
const onlineEnv =
|
33
|
|
- process.env.REACT_APP_DISABLE_SENTRY !== "true" &&
|
|
37
|
+ !REACT_APP_DISABLE_SENTRY &&
|
34
|
38
|
Object.keys(SentryEnvHostnameMap).find(
|
35
|
39
|
(item) => window.location.hostname.indexOf(item) >= 0,
|
36
|
40
|
);
|
|
@@ -40,7 +44,7 @@ Sentry.init({
|
40
|
44
|
? "https://7bfc596a5bf945eda6b660d3015a5460@sentry.io/5179260"
|
41
|
45
|
: undefined,
|
42
|
46
|
environment: onlineEnv ? SentryEnvHostnameMap[onlineEnv] : undefined,
|
43
|
|
- release: process.env.REACT_APP_GIT_SHA,
|
|
47
|
+ release: REACT_APP_GIT_SHA,
|
44
|
48
|
ignoreErrors: [
|
45
|
49
|
"undefined is not an object (evaluating 'window.__pad.performLoop')", // Only happens on Safari, but spams our servers. Doesn't break anything
|
46
|
50
|
],
|
|
@@ -51,6 +55,8 @@ Sentry.init({
|
51
|
55
|
],
|
52
|
56
|
});
|
53
|
57
|
|
|
58
|
+window.__EXCALIDRAW_SHA__ = REACT_APP_GIT_SHA;
|
|
59
|
+
|
54
|
60
|
// Block pinch-zooming on iOS outside of the content area
|
55
|
61
|
document.addEventListener(
|
56
|
62
|
"touchmove",
|