diff --git a/src/main/webapp/src/views/AppView.vue b/src/main/webapp/src/views/AppView.vue index 737e84d5..17f0fee5 100644 --- a/src/main/webapp/src/views/AppView.vue +++ b/src/main/webapp/src/views/AppView.vue @@ -115,11 +115,21 @@ const preventExit = (e: Event): void => { e.preventDefault(); }; +watch( + title, + (newValue) => { + if (newValue.trim() != '') document.title = `${newValue} - ${__APP_NAME__}`; + else if (document.title != __APP_NAME__) document.title = __APP_NAME__; + }, + { immediate: true }, +); + onMounted(() => { window.addEventListener('beforeunload', preventExit); }); onUnmounted(() => { + if (document.title != __APP_NAME__) document.title = __APP_NAME__; window.removeEventListener('beforeunload', preventExit); exitAppContext(); });