@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
44import ImmutablePropTypes from 'react-immutable-proptypes' ;
55import Bowser from 'bowser' ;
66import bindAll from 'lodash/bindAll' ;
7- import includes from 'lodash/includes' ;
87import { t } from 'i18next' ;
98import normalizeError from '../util/normalizeError' ;
109import retryingFailedImports from '../util/retryingFailedImports' ;
@@ -32,13 +31,10 @@ class PreviewFrame extends React.Component {
3231 }
3332
3433 componentWillReceiveProps ( newProps ) {
35- if ( includes ( this . props . focusedEditors , 'css' ) &&
36- ! includes ( newProps . focusedEditors , 'css' ) ) {
37- this . _postRemoveHighlightToFrame ( ) ;
38- }
39- if ( newProps . focusedSelector !== this . props . focusedSelector ||
40- includes ( newProps . focusedEditors , 'css' ) ) {
34+ if ( newProps . focusedSelector && newProps . focusedEditor === 'css' ) {
4135 this . _postFocusedSelectorToFrame ( newProps . focusedSelector ) ;
36+ } else {
37+ this . _postFocusedSelectorToFrame ( null ) ;
4238 }
4339 const { consoleEntries : previousConsoleEntries , isActive} = this . props ;
4440
@@ -137,12 +133,6 @@ class PreviewFrame extends React.Component {
137133 } ) ;
138134 }
139135
140- _postRemoveHighlightToFrame ( ) {
141- this . _channel . notify ( {
142- method : 'removeHighlight' ,
143- } ) ;
144- }
145-
146136 _handleConsoleLog ( printedValue ) {
147137 const { compiledProjectKey} = this . props . compiledProject ;
148138 this . props . onConsoleLog ( printedValue , compiledProjectKey ) ;
@@ -198,7 +188,6 @@ class PreviewFrame extends React.Component {
198188PreviewFrame . propTypes = {
199189 compiledProject : PropTypes . instanceOf ( CompiledProjectRecord ) . isRequired ,
200190 consoleEntries : ImmutablePropTypes . iterable . isRequired ,
201- focusedEditors : PropTypes . array ,
202191 focusedSelector : PropTypes . string ,
203192 isActive : PropTypes . bool . isRequired ,
204193 onConsoleError : PropTypes . func . isRequired ,
@@ -208,7 +197,6 @@ PreviewFrame.propTypes = {
208197} ;
209198
210199PreviewFrame . defaultProps = {
211- focusedEditors : null ,
212200 focusedSelector : null ,
213201} ;
214202
0 commit comments