remove disabled/uninvokable things from the search list

This commit is contained in:
fuwaa 2022-08-24 16:33:23 +08:00
parent 98de90c90e
commit 513438deb6
No known key found for this signature in database
GPG key ID: 7CE0BF0D3175E2DC
2 changed files with 4 additions and 2 deletions

View file

@ -28,7 +28,7 @@ export default Option = (props) => {
const status = { const status = {
color: color:
state === "notworking" state === "notworking"
? "var(--light-red)" ? "var(--disabled-text-color)"
: state === "untested" : state === "untested"
? "var(light-yellow)" ? "var(light-yellow)"
: state === "buggy" : state === "buggy"
@ -59,7 +59,7 @@ export default Option = (props) => {
className="nomargin topresult" className="nomargin topresult"
style={{ color: "var(--disabled-text-color)" }} style={{ color: "var(--disabled-text-color)" }}
> >
<em>command palette can't invoke this command properly.</em> <em>support for invoking this command coming soon.</em>
</span> </span>
) : null}{" "} ) : null}{" "}
{state === "buggy" ? ( {state === "buggy" ? (

View file

@ -60,6 +60,8 @@ const CommandPalette = (props) => {
const normalText = command.name.toLowerCase(); const normalText = command.name.toLowerCase();
const commandCat = command.category.toLowerCase(); const commandCat = command.category.toLowerCase();
const commandAction = command.command.toLowerCase(); const commandAction = command.command.toLowerCase();
if (command.state === "disabled" || command.state === "notworking")
return;
let textFilter = normalText.includes(query.toLowerCase()); let textFilter = normalText.includes(query.toLowerCase());
let categoryFilter = commandCat.includes(query.toLowerCase()); let categoryFilter = commandCat.includes(query.toLowerCase());
let actionFilter = commandAction.includes(query.toLowerCase()); let actionFilter = commandAction.includes(query.toLowerCase());