From bf6d72147eea6c4d334f8132a25451dd21a53a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Sat, 28 Oct 2023 23:51:57 +0200 Subject: [PATCH] confirm reload in admin view --- ui/src/components/admin/AdminView.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/src/components/admin/AdminView.vue b/ui/src/components/admin/AdminView.vue index 5c771c9..f417c08 100644 --- a/ui/src/components/admin/AdminView.vue +++ b/ui/src/components/admin/AdminView.vue @@ -18,5 +18,16 @@ import DoorMapEditor from "./DoorMapEditor.vue"; DoorMapEditor, }, }) -export default class extends Vue {} +export default class extends Vue { + private old_handler = window.onbeforeunload; + private confirm_handler = () => ""; + + public mounted(): void { + window.onbeforeunload = this.confirm_handler; + } + + public beforeUnmount(): void { + window.onbeforeunload = this.old_handler; + } +}