Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// only use fastclick if we are on iOS
if (isIOS()) {
require('react-fastclick')
}
/* eslint-enable global-require */
function shouldScroll(prevRouterProps, currentRouterProps) {
const { location } = currentRouterProps
if (location.action === 'PUSH' && location.query.submissionType) {
return false
}
return location.action !== 'REPLACE'
}
if (ENV.HONEYBADGER_API_KEY && ENV.HONEYBADGER_ENVIRONMENT) {
Honeybadger.configure({
api_key: ENV.HONEYBADGER_API_KEY,
environment: ENV.HONEYBADGER_ENVIRONMENT,
})
}
updateTimeAgoStrings({ about: '' })
const APP_VERSION = '4.0.0'
const createSelectLocationState = () => {
let prevRoutingState
let prevRoutingStateJS
return (state) => {
const routingState = state.routing
if (typeof prevRoutingState === 'undefined' || prevRoutingState !== routingState) {
prevRoutingState = routingState
import {ErrorInfo} from 'react'
import HoneyBadger from 'honeybadger-js'
import {CLOUD, GIT_SHA} from 'src/shared/constants'
import {getUserFlags} from 'src/shared/utils/featureFlag'
import {event} from 'src/cloud/utils/reporting'
if (CLOUD) {
HoneyBadger.configure({
apiKey: process.env.HONEYBADGER_KEY,
revision: GIT_SHA,
environment: process.env.HONEYBADGER_ENV,
})
}
// See https://docs.honeybadger.io/lib/javascript/guides/reporting-errors.html#additional-options
interface HoneyBadgerAdditionalOptions {
component?: string
context?: {[key: string]: any}
cookies?: {[key: string]: any}
name?: string
params?: {[key: string]: any}
}
export const reportError = (
install (Vue, options) {
if (Vue.config.debug) {
console.log(`Honeybadger configured with ${options.apiKey}`)
}
const honeybadger = Honeybadger.configure(options)
Vue.$honeybadger = honeybadger
Vue.prototype.$honeybadger = Vue.$honeybadger
const chainedErrorHandler = Vue.config.errorHandler
let extractContext = function (vm) {
var options = typeof vm === 'function' && vm.cid != null ? vm.options : vm._isVue ? vm.$options ||
vm.constructor.options : vm || {}
var name = options.name || options._componentTag
var file = options.__file
return {
isRoot: vm.$root === vm,
name: name,
props: options.propsData,
parentVnodeTag: options._parentVnode ? options._parentVnode.tag : undefined,
file: file
}
}