diff --git a/src/pages/account/miieditor.vue b/src/pages/account/miieditor.vue index e5a71bf..435f9aa 100644 --- a/src/pages/account/miieditor.vue +++ b/src/pages/account/miieditor.vue @@ -19,7 +19,19 @@ useHead({ title: 'Mii Editor | Pretendo Network' }); -// TODO: literally all the backend stuff +const beforeUnload = (e: BeforeUnloadEvent) => { + e?.preventDefault(); + e.returnValue = ''; +}; + +onMounted(() => { + window.addEventListener('beforeunload', beforeUnload); +}); + +onBeforeUnmount(() => { + window.removeEventListener('beforeunload', beforeUnload); +}); + const fallbackMiiData = 'AwAAQOlVognnx0GC2qjhdwOzuI0n2QAAAGBzAHQAZQB2AGUAAAAAAAAAAAAAAEBAAAAhAQJoRBgmNEYUgRIXaA0AACkAUkhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAANeC'; const miiDataString: string = profile.value?.mii?.data || fallbackMiiData;