Skip to content

Commit 241afa8

Browse files
author
chunqiuyiyu
committed
check searchAPI WS before closing it
1 parent 0f6ebdf commit 241afa8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/components/Search/search.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as delegate from 'commons/Search/action'
88
import icons from 'file-icons-js'
99
import { Aa, Word, Reg } from './icons'
1010
import * as api from 'backendAPI/searchAPI'
11+
import config from 'config'
1112

1213
const hoverColor = '#337ab7'
1314

@@ -78,7 +79,9 @@ class SearchPanel extends Component {
7879
}
7980

8081
componentWillUnmount() {
81-
api.searchWorkspaceDown()
82+
if (config.searchSocketConnected) {
83+
api.searchWorkspaceDown()
84+
}
8285
}
8386

8487
onKeyDown = (e) => {

0 commit comments

Comments
 (0)