From 48db676f2004562aa1cbc000f89f27264b6e8d10 Mon Sep 17 00:00:00 2001 From: Oskar Hane Date: Fri, 13 Oct 2017 16:39:58 +0200 Subject: [PATCH] Remove unused code --- .../components/DesktopIntegration/index.jsx | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/browser/components/DesktopIntegration/index.jsx b/src/browser/components/DesktopIntegration/index.jsx index 05d87c18901..3c2db5464ab 100644 --- a/src/browser/components/DesktopIntegration/index.jsx +++ b/src/browser/components/DesktopIntegration/index.jsx @@ -22,23 +22,16 @@ import { Component } from 'preact' import { getActiveGraph, getCredentials, eventToHandler } from './helpers' export default class DesktopIntegration extends Component { - state = { - listenerSetup: false, - cachedConnectionCredentials: {} - } setupListener = props => { - if (this.state.listenerSetup) return const { integrationPoint } = props // Run on context updates if (integrationPoint && integrationPoint.onContextUpdate) { - const listenerSetup = () => - integrationPoint.onContextUpdate((event, newContext, oldContext) => { - const handlerPropName = eventToHandler(event.type) - if (!handlerPropName) return - if (typeof this.props[handlerPropName] === 'undefined') return - this.props[handlerPropName](event, newContext, oldContext) - }) - this.setState({ listenerSetup: true }, listenerSetup) + integrationPoint.onContextUpdate((event, newContext, oldContext) => { + const handlerPropName = eventToHandler(event.type) + if (!handlerPropName) return + if (typeof this.props[handlerPropName] === 'undefined') return + this.props[handlerPropName](event, newContext, oldContext) + }) } } checkContextForActiveConnection = props => { @@ -63,9 +56,6 @@ export default class DesktopIntegration extends Component { this.checkContextForActiveConnection(this.props) this.setupListener(this.props) } - componentWillReceiveProps (props) { - this.setupListener(props) - } render = () => { return null }