From adbe740edfafa9607055bd139a7467a78cd2eea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Tue, 21 Nov 2023 22:37:00 +0000 Subject: [PATCH] remove declare $refs --- ui/src/components/LoginModal.vue | 9 ++------- ui/src/components/editor/PreviewDoor.vue | 4 ---- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/ui/src/components/LoginModal.vue b/ui/src/components/LoginModal.vue index 399f274..b2d0612 100644 --- a/ui/src/components/LoginModal.vue +++ b/ui/src/components/LoginModal.vue @@ -65,10 +65,6 @@ export default class extends Vue { public username = ""; public password = ""; - declare $refs: { - username_input: HTMLInputElement | unknown; - }; - private on_keydown(e: KeyboardEvent) { if (e.key == "Enter") this.submit(); else if (e.key == "Escape") this.cancel(); @@ -78,9 +74,8 @@ export default class extends Vue { window.addEventListener("keydown", this.on_keydown); this.$nextTick(() => { - if (this.$refs.username_input instanceof HTMLInputElement) { - this.$refs.username_input.focus(); - } + if (!(this.$refs.username_input instanceof HTMLElement)) return; + this.$refs.username_input.focus(); }); } diff --git a/ui/src/components/editor/PreviewDoor.vue b/ui/src/components/editor/PreviewDoor.vue index de58486..ab8db18 100644 --- a/ui/src/components/editor/PreviewDoor.vue +++ b/ui/src/components/editor/PreviewDoor.vue @@ -43,10 +43,6 @@ export default class extends Vue { public day_str = ""; public editing = false; - declare $refs: { - day_input: HTMLInputElement | unknown; - }; - private toggle_editing() { this.day_str = String(this.door.day); this.editing = !this.editing;