@@ -3,7 +3,6 @@ import * as PageTransition from "../states/page-transition";
33import Config from "../config" ;
44import * as TestWords from "../test/test-words" ;
55import { getCommandline } from "../utils/async-modules" ;
6- import { log } from "../controllers/analytics-controller" ;
76import * as Notifications from "../elements/notifications" ;
87
98document . addEventListener ( "keydown" , async ( e ) => {
@@ -32,8 +31,6 @@ document.addEventListener("keydown", async (e) => {
3231
3332window . onerror = function ( message , url , line , column , error ) : void {
3433 if ( Misc . isDevEnvironment ( ) ) {
35- //this is causing errors when using chrome responsive design dev tools
36- if ( error ?. message . includes ( "x_magnitude" ) ) return ;
3734 Notifications . add ( error ?. message ?? "Undefined message" , - 1 , {
3835 customTitle : "DEV: Unhandled error" ,
3936 duration : 5 ,
@@ -44,13 +41,14 @@ window.onerror = function (message, url, line, column, error): void {
4441
4542window . onunhandledrejection = function ( e ) : void {
4643 if ( Misc . isDevEnvironment ( ) ) {
47- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
48- const message = ( e . reason . message ?? e . reason ) as string ;
49- Notifications . add ( `${ message } ` , - 1 , {
50- customTitle : "DEV: Unhandled rejection" ,
51- duration : 5 ,
52- important : true ,
53- } ) ;
54- console . error ( e ) ;
44+ Notifications . add (
45+ ( e . reason as Error ) . message ?? e . reason ?? "Undefined message" ,
46+ - 1 ,
47+ {
48+ customTitle : "DEV: Unhandled rejection" ,
49+ duration : 5 ,
50+ important : true ,
51+ }
52+ ) ;
5553 }
5654} ;
0 commit comments