Skip to content

Commit eaa8978

Browse files
committed
fix: sentry in auto build
1 parent 9822f1c commit eaa8978

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
run: npm publish # Publish builds automatically
4444
env:
4545
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
4647
- name: Tag and Release
4748
uses: softprops/action-gh-release@v1
4849
with:

src/utils/sentry.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ const GUEST = {
44
id: 0,
55
username: 'Guest',
66
};
7-
const dsn = '__SENTRY__';
87

98
function invalid() {
10-
return !window.Sentry;
9+
return typeof Sentry === 'undefined';
1110
}
1211

1312
export function init() {
1413
if (invalid()) return;
1514
const config = {
15+
dsn: '__SENTRY__',
1616
release: 'underscript@__VERSION__',
1717
replaysSessionSampleRate: 0.1,
1818
replaysOnErrorSampleRate: 1.0,
@@ -24,7 +24,6 @@ export function init() {
2424
user: GUEST,
2525
},
2626
};
27-
if (dsn) config.dsn = dsn;
2827
Sentry.init(config);
2928
}
3029

0 commit comments

Comments
 (0)