mirror of
https://github.com/ryanamay/inkdrop-command-palette.git
synced 2024-09-20 01:40:34 +00:00
remove disabled/uninvokable things from the search list
This commit is contained in:
parent
98de90c90e
commit
513438deb6
2 changed files with 4 additions and 2 deletions
|
@ -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" ? (
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Reference in a new issue