feat: toggle Sentry and API url when loading site from localhost

This commit is contained in:
spiral 2022-04-07 09:21:57 -04:00
parent 621272c842
commit 01f76c77f0
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import axios from 'axios';
import * as Sentry from '@sentry/browser';
const baseUrl = () => localStorage.isBeta ? "https://api.beta.pluralkit.me" : "https://api.pluralkit.me";
const baseUrl = () => window.location.origin.includes("localhost") ? "http://localhost:5000" : localStorage.isBeta ? "https://api.beta.pluralkit.me" : "https://api.pluralkit.me";
const methods = ['get', 'post', 'delete', 'patch', 'put'];
const noop = () => {};

View File

@ -5,7 +5,7 @@ Sentry.init({
dsn: "https://58109fec589f4c2bbfa190329acf679a@sentry.pluralkit.me/4",
integrations: [new Integrations.BrowserTracing()],
enabled: true,
enabled: !window.location.origin.includes("localhost"),
debug: false,
release: "dev",
// Set tracesSampleRate to 1.0 to capture 100%