launcher: fix actions not clearing in math mode
This commit is contained in:
parent
619508b16c
commit
d81454cd91
1 changed files with 5 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ const getPrettyMode = (mode: Mode) => {
|
||||||
return mode;
|
return mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isAction = (text: string) => text.startsWith(config.actionPrefix.get());
|
const isAction = (text: string, action: string = "") => text.startsWith(config.actionPrefix.get() + action);
|
||||||
|
|
||||||
const SearchBar = ({ mode, entry }: { mode: Variable<Mode>; entry: Widget.Entry }) => (
|
const SearchBar = ({ mode, entry }: { mode: Variable<Mode>; entry: Widget.Entry }) => (
|
||||||
<box className="search-bar">
|
<box className="search-bar">
|
||||||
|
|
@ -127,7 +127,10 @@ export default class Launcher extends PopupWindow {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Clear search on hide if not in math mode or creating a todo
|
// Clear search on hide if not in math mode or creating a todo
|
||||||
this.connect("hide", () => mode.get() !== "math" && !entry.text.startsWith(">todo") && entry.set_text(""));
|
this.connect("hide", () => {
|
||||||
|
if ((mode.get() !== "math" || isAction(entry.get_text())) && !isAction(entry.get_text(), "todo"))
|
||||||
|
entry.set_text("");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
open(mode: Mode) {
|
open(mode: Mode) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue