Browse Source

Adding Sentry error monitoring

master
Mobius K 2 years ago
parent
commit
9187734705
  1. 6
      scripts/environment.prod.ts
  2. 6
      scripts/environment.ts
  3. 22
      scripts/index.ts

6
scripts/environment.prod.ts

@ -0,0 +1,6 @@
// Environment variables that apply to the production profile
export const environment = {
production: true,
};

6
scripts/environment.ts

@ -0,0 +1,6 @@
// Environment variables that apply to the development profile
export const environment = {
production: false,
};

22
scripts/index.ts

@ -1,6 +1,21 @@
import { environment } from "bluetooth-class/scripts/environment";
import { ErrorMonitor } from "shared/scripts/error-monitor";
// This entire application relies on bitwise operators, so we'll stop tslint from complaining right away
// tslint:disable:no-bitwise
// Start the error watcher for the production environment
if (environment.production) {
new ErrorMonitor("https://ab6fd35ef01e438eb32719f4d92ee084@sentry.io/5178420");
}
// Load our service worker to enable PWA functionality
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("service-worker.js").then();
});
}
// Container for our bluetooth class code
let bluetoothClass = 0;
@ -74,10 +89,3 @@ checkboxesAndRadios.forEach((element: HTMLInputElement) => {
// Default the bluetooth class field and minor device fields on page load
updateBluetoothClassField();
updateBluetoothMinorDeviceFields();
// Load our service worker to enable PWA functionality
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("service-worker.js").then();
});
}

Loading…
Cancel
Save