Skip to content

Commit

Permalink
fix(typing): first space sometimes soft locking the website
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Feb 19, 2024
1 parent 0cc1e2a commit e94b9cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions frontend/src/ts/controllers/input-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import * as TestWords from "../test/test-words";
import * as Hangul from "hangul-js";
import * as CustomTextState from "../states/custom-text-name";
import * as FunboxList from "../test/funbox/funbox-list";
import * as Settings from "../pages/settings";
import * as KeymapEvent from "../observables/keymap-event";
import { IgnoredKeys } from "../constants/ignored-keys";
import { ModifierKeys } from "../constants/modifier-keys";
Expand Down Expand Up @@ -193,7 +192,6 @@ function handleSpace(): void {
f.functions.handleSpace();
}
}
Settings.groups["layout"]?.updateUI();

dontInsertSpace = true;

Expand Down
7 changes: 6 additions & 1 deletion frontend/src/ts/settings/settings-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ export default class SettingsGroup<T extends SharedTypes.ConfigValue> {
if (this.mode === "select") {
const select = document.querySelector(
`.pageSettings .section[data-config-name='${this.configName}'] select`
) as HTMLSelectElement;
) as HTMLSelectElement | null;

if (select === null) {
return;
}

select.value = this.configValue as string;

//@ts-expect-error
Expand Down

0 comments on commit e94b9cb

Please sign in to comment.