mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-27 16:24:41 +08:00
fix(custom words filter): add button overriding custom text state
also added a notification when no words were found when filtering closes #4785
This commit is contained in:
parent
2ba23567fb
commit
9d8d8dc544
2 changed files with 8 additions and 1 deletions
|
@ -361,7 +361,7 @@ $(document).on("keydown", (event) => {
|
|||
});
|
||||
|
||||
$("#popups").on("click", `${popup} .wordfilter`, () => {
|
||||
hide({ noAnim: true });
|
||||
hide({ noAnim: true, resetState: false });
|
||||
WordFilterPopup.show(true, () => {
|
||||
show(true);
|
||||
});
|
||||
|
|
|
@ -260,6 +260,13 @@ async function filter(language: string): Promise<string[]> {
|
|||
async function apply(set: boolean): Promise<void> {
|
||||
const language = $("#wordFilterPopup .languageInput").val() as string;
|
||||
const filteredWords = await filter(language);
|
||||
|
||||
if (filteredWords.length === 0) {
|
||||
Notifications.add("No words found", 0);
|
||||
hide(true);
|
||||
return;
|
||||
}
|
||||
|
||||
const customText = filteredWords.join(CustomText.delimiter);
|
||||
|
||||
CustomText.setPopupTextareaState(
|
||||
|
|
Loading…
Reference in a new issue