Refactor & add error reporing
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import * as React from 'react'
|
||||
import { electronRendererTelementry } from 'electron-telemetry'
|
||||
import {
|
||||
Button,
|
||||
Modal,
|
||||
@@ -27,6 +28,7 @@ class ErrorBoundary extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
public componentDidCatch(error: Error, errorInfo: any) {
|
||||
electronRendererTelementry.trackError(error)
|
||||
console.log('did catch', error)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { electronRendererTelementry } from 'electron-telemetry'
|
||||
|
||||
const spareMeFromGc = electronRendererTelementry
|
||||
electronRendererTelementry.registerErrorHandler()
|
||||
@@ -3,8 +3,8 @@ import * as q from '../../../backend/src/Model'
|
||||
|
||||
import { AppBar, Button, IconButton, InputBase, Toolbar, Typography } from '@material-ui/core'
|
||||
import { StyleRulesCallback, withStyles } from '@material-ui/core/styles'
|
||||
import CloudOff from '@material-ui/icons/CloudOff'
|
||||
|
||||
import CloudOff from '@material-ui/icons/CloudOff'
|
||||
import Menu from '@material-ui/icons/Menu'
|
||||
import Search from '@material-ui/icons/Search'
|
||||
import { bindActionCreators } from 'redux'
|
||||
@@ -106,18 +106,17 @@ class TitleBar extends React.Component<Props, State> {
|
||||
private renderSearch() {
|
||||
const { classes } = this.props
|
||||
|
||||
return <div className={classes.search}>
|
||||
<div className={classes.searchIcon}>
|
||||
<Search />
|
||||
return (
|
||||
<div className={classes.search}>
|
||||
<div className={classes.searchIcon}>
|
||||
<Search />
|
||||
</div>
|
||||
<InputBase
|
||||
placeholder="Search…"
|
||||
classes={{ root: classes.inputRoot, input: classes.inputInput }}
|
||||
/>
|
||||
</div>
|
||||
<InputBase
|
||||
placeholder="Search…"
|
||||
classes={{
|
||||
root: classes.inputRoot,
|
||||
input: classes.inputInput,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ class Tree extends React.Component<Props, TreeState> {
|
||||
}
|
||||
|
||||
private handleNewData = (msg: any) => {
|
||||
console.log('new data')
|
||||
const edges = msg.topic.split('/')
|
||||
const node = q.TreeNodeFactory.fromEdgesAndValue(edges, Buffer.from(msg.payload, 'base64').toString())
|
||||
this.state.tree.updateWithNode(node.firstNode())
|
||||
|
||||
@@ -148,7 +148,6 @@ const reducer: Reducer<AppState | undefined, CustomAction> = (state = initialApp
|
||||
if (!action.connectionId) {
|
||||
return state
|
||||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
connected: false,
|
||||
@@ -165,7 +164,6 @@ const reducer: Reducer<AppState | undefined, CustomAction> = (state = initialApp
|
||||
}
|
||||
|
||||
case ActionTypes.connected:
|
||||
|
||||
return {
|
||||
...state,
|
||||
connected: true,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { rendererEvents, trackError, trackUserInteraction } from '../../events'
|
||||
import { rendererEvents } from '../../events'
|
||||
let userId = window.localStorage.getItem('userId')
|
||||
const sha1 = require('sha1')
|
||||
import { electronRendererTelementry } from 'electron-telemetry'
|
||||
|
||||
if (!userId) {
|
||||
userId = sha1(sha1(Math.random()) + sha1(performance.now()) + sha1(Date.now())).slice(0, 8) as string
|
||||
@@ -19,4 +20,5 @@ export function trackEvent(name: string) {
|
||||
return
|
||||
}
|
||||
Nucleus.track(name)
|
||||
electronRendererTelementry.trackEvent(name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user