Skip to content

Commit

Permalink
Init search WS when search panel is opening
Browse files Browse the repository at this point in the history
  • Loading branch information
chunqiuyiyu authored and xunfeng1980 committed Dec 21, 2018
1 parent 688c92c commit 78b232d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 5 additions & 1 deletion app/components/Search/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { openFile } from 'commands/commandBindings/file'
import * as delegate from 'commons/Search/action'
import icons from 'file-icons-js'
import { Aa, Word, Reg } from './icons'
import * as api from 'backendAPI/searchAPI'
import api from 'backendAPI/'
import config from 'config'

const hoverColor = '#337ab7'
Expand Down Expand Up @@ -74,6 +74,10 @@ export class SearchResultItem extends Component {

@observer
class SearchPanel extends Component {
componentWillMount() {
api.connectSearchWebsocketClient()
}

componentDidMount () {
subscribeToSearch()
}
Expand Down
5 changes: 0 additions & 5 deletions app/initialize/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ const stepCache = observable.map({
func: () =>
api.connectWebsocketClient()
},
connectSearchSocket: {
desc: 'Connect Search Websocket',
func: () =>
api.connectSearchWebsocketClient()
},
preventAccidentalClose: {
desc: 'Prevent accidental close',
func: () => {
Expand Down
5 changes: 0 additions & 5 deletions app/workstation/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@ const stepCache = observable.map({
func: () =>
api.connectWebsocketClient()
},
connectSearchSocket: {
desc: 'Connect Search WebSocket',
func: () =>
api.connectSearchWebsocketClient()
},
getProjectType: {
desc: 'Estimate project type -- platform',
enable: config.isPlatform,
Expand Down

0 comments on commit 78b232d

Please sign in to comment.