Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit bdf181b

Browse files
committed
refactor(hilight-words): support cmd-chain & user search
1 parent 18c1f50 commit bdf181b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

containers/Doraemon/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class DoraemonContainer extends React.Component {
3535
const { doraemon } = this.props
3636
const {
3737
inputValue,
38+
inputValueRaw,
3839
suggestions,
3940
activeRaw,
4041
prefix,
@@ -64,7 +65,7 @@ class DoraemonContainer extends React.Component {
6465
<AlertBar value={inputValue} searchThread={searchThread} />
6566
)}
6667
<ResultsList
67-
searchValue={inputValue}
68+
searchValue={inputValueRaw}
6869
suggestions={suggestions}
6970
activeRaw={activeRaw}
7071
searchThread={searchThread}

containers/Doraemon/store.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ const DoraemonStore = t
7979
get curRoute() {
8080
return self.root.curRoute
8181
},
82+
get inputValueRaw() {
83+
if (R.startsWith('/', self.inputValue)) {
84+
return R.last(self.inputValue.split('/'))
85+
}
86+
if (R.startsWith('@', self.inputValue)) return self.inputValue.slice(1)
87+
88+
return self.inputValue
89+
},
8290
get curCmdChain() {
8391
if (!self.cmdChain && self.activeRaw) {
8492
return [self.activeRaw]

0 commit comments

Comments
 (0)