aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/ProxyApp.jsx
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-10-31 05:30:32 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-11-08 17:54:27 +0100
commit85476d9915f23fc45e64b5242e804623f50cd20a (patch)
tree9fdca1d74c1bcf3f9dafc26cd4d2786c3ae8b81e /web/src/js/components/ProxyApp.jsx
parent62ca89649237cb0aff63b1fd3d7729b42134bdd1 (diff)
downloadmitmproxy-85476d9915f23fc45e64b5242e804623f50cd20a.tar.gz
mitmproxy-85476d9915f23fc45e64b5242e804623f50cd20a.tar.bz2
mitmproxy-85476d9915f23fc45e64b5242e804623f50cd20a.zip
clean up mitmweb
Diffstat (limited to 'web/src/js/components/ProxyApp.jsx')
-rw-r--r--web/src/js/components/ProxyApp.jsx59
1 files changed, 0 insertions, 59 deletions
diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx
index d76816e5..18976de0 100644
--- a/web/src/js/components/ProxyApp.jsx
+++ b/web/src/js/components/ProxyApp.jsx
@@ -1,13 +1,7 @@
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
-import { createHashHistory, useQueries } from 'history'
-import { init as appInit, destruct as appDestruct } from '../ducks/app'
import { onKeyDown } from '../ducks/ui/keyboard'
-import { updateFilter, updateHighlight } from '../ducks/flowView'
-import { selectTab } from '../ducks/ui/flow'
-import { select as selectFlow } from '../ducks/flows'
-import { Query } from '../actions'
import MainView from './MainView'
import Header from './Header'
import EventLog from './EventLog'
@@ -15,57 +9,14 @@ import Footer from './Footer'
class ProxyAppMain extends Component {
- flushToStore(location) {
- const components = location.pathname.split('/').filter(v => v)
- const query = location.query || {}
-
- if (components.length > 2) {
- this.props.selectFlow(components[1])
- this.props.selectTab(components[2])
- } else {
- this.props.selectFlow(null)
- this.props.selectTab(null)
- }
-
- this.props.updateFilter(query[Query.SEARCH])
- this.props.updateHighlight(query[Query.HIGHLIGHT])
- }
-
- flushToHistory(props) {
- const query = { ...query }
-
- if (props.filter) {
- query[Query.SEARCH] = props.filter
- }
-
- if (props.highlight) {
- query[Query.HIGHLIGHT] = props.highlight
- }
-
- if (props.selectedFlowId) {
- this.history.push({ pathname: `/flows/${props.selectedFlowId}/${props.tab}`, query })
- } else {
- this.history.push({ pathname: '/flows', query })
- }
- }
-
componentWillMount() {
- this.props.appInit()
- this.history = useQueries(createHashHistory)()
- this.unlisten = this.history.listen(location => this.flushToStore(location))
window.addEventListener('keydown', this.props.onKeyDown);
}
componentWillUnmount() {
- this.props.appDestruct()
- this.unlisten()
window.removeEventListener('keydown', this.props.onKeyDown);
}
- componentWillReceiveProps(nextProps) {
- this.flushToHistory(nextProps)
- }
-
render() {
const { showEventLog, location, filter, highlight } = this.props
return (
@@ -84,18 +35,8 @@ class ProxyAppMain extends Component {
export default connect(
state => ({
showEventLog: state.eventLog.visible,
- filter: state.flowView.filter,
- highlight: state.flowView.highlight,
- tab: state.ui.flow.tab,
- selectedFlowId: state.flows.selected[0]
}),
{
- appInit,
- appDestruct,
onKeyDown,
- updateFilter,
- updateHighlight,
- selectTab,
- selectFlow
}
)(ProxyAppMain)