import { error } from "../../store/slices/messages-slice" ; import store from "../../store/store" ; import { messages } from "../../constants/messages" ; const interceptedConsoleMessages = [ "Wrong network, please switch to mainnet" ] ; var consoleInterceptor = function ( message ) { if ( interceptedConsoleMessages . includes ( message ) ) { store . dispatch ( error ( { text : messages . something_wrong , error : message } ) ) ; } console . _error_old ( message ) ; } ; consoleInterceptor . isInterceptor = true ; if ( console . error . isInterceptor != true ) { console . _error_old = console . error ; console . error = consoleInterceptor ; }