Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit ff59534

Browse files
Łukasz SobekjasonLaster
authored andcommitted
Removes sad face when source+goto (#5444)
* Removes sad face from Source goto queries * Refactors code
1 parent 339e504 commit ff59534

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/components/QuickOpenModal.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,15 @@ export class QuickOpenModal extends Component<Props, State> {
110110
this.props.closeQuickOpen();
111111
};
112112

113+
dropGoto = (query: string) => {
114+
return query.split(":")[0];
115+
};
116+
113117
searchSources = (query: string) => {
114-
if (query == "") {
115-
const results = this.props.sources;
116-
return this.setState({ results });
117-
}
118-
if (this.isGotoSourceQuery()) {
119-
const [baseQuery] = query.split(":");
120-
const results = filter(this.props.sources, baseQuery);
121-
this.setState({ results });
122-
} else {
123-
const results = filter(this.props.sources, query);
124-
this.setState({ results });
125-
}
118+
const { sources } = this.props;
119+
const results =
120+
query == "" ? sources : filter(sources, this.dropGoto(query));
121+
return this.setState({ results });
126122
};
127123

128124
searchSymbols = (query: string) => {

0 commit comments

Comments
 (0)