fix: convert bugsnag to static import
This commit is contained in:
@@ -71,7 +71,7 @@ async function startApplication(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
SNLog.onLog = console.log;
|
SNLog.onLog = console.log;
|
||||||
await startErrorReporting();
|
startErrorReporting();
|
||||||
|
|
||||||
angular.module('app', ['ngSanitize']);
|
angular.module('app', ['ngSanitize']);
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { SNLog } from 'snjs';
|
import { SNLog } from 'snjs';
|
||||||
import { isDesktopApplication, isDev } from '@/utils';
|
import { isDesktopApplication, isDev } from '@/utils';
|
||||||
import { storage, StorageKey } from './localStorage';
|
import { storage, StorageKey } from './localStorage';
|
||||||
|
import Bugsnag from '@bugsnag/js';
|
||||||
|
|
||||||
declare const __VERSION__: string;
|
declare const __VERSION__: string;
|
||||||
|
|
||||||
export async function startErrorReporting() {
|
export function startErrorReporting() {
|
||||||
if (storage.get(StorageKey.DisableErrorReporting)) {
|
if (storage.get(StorageKey.DisableErrorReporting)) {
|
||||||
SNLog.onError = console.error;
|
SNLog.onError = console.error;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { default: Bugsnag } = await import('@bugsnag/js');
|
|
||||||
Bugsnag.start({
|
Bugsnag.start({
|
||||||
apiKey: (window as any)._bugsnag_api_key,
|
apiKey: (window as any)._bugsnag_api_key,
|
||||||
appType: isDesktopApplication() ? 'desktop' : 'web',
|
appType: isDesktopApplication() ? 'desktop' : 'web',
|
||||||
@@ -28,5 +28,6 @@ export async function startErrorReporting() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to start Bugsnag.', error);
|
console.error('Failed to start Bugsnag.', error);
|
||||||
|
SNLog.onError = console.error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user