small fix to flickering window buttons on routing

This commit is contained in:
Elvanos 2023-11-23 00:01:15 +01:00
parent cc85318d02
commit d8a3585854
2 changed files with 12 additions and 4 deletions

View file

@ -42,7 +42,9 @@
</q-tooltip>
<q-icon
size="16px"
:name="(isMaximized)? 'mdi-window-restore' : 'mdi-window-maximize'"
:name="(isMaximized)
? 'mdi-window-restore'
: 'mdi-window-maximize'"
/>
</q-btn>
@ -120,7 +122,7 @@ const checkIfWindowMaximized = () => {
/**
* Determines if the window is currently maximized or not
*/
const isMaximized: Ref<boolean> = ref(false)
const isMaximized: Ref<boolean> = ref(true)
/**
* Window interval checker variable
@ -129,13 +131,17 @@ let checkerInterval: number
/**
* Hook up a interval timer on mount for continuous checking
* This done due to the fact that dragging via the top header bar doesn't properly fire "drag" event
* This is done due to the fact that dragging via the top header bar doesn't properly fire "drag" event
* Async due to UI render blocking
*/
onMounted(async () => {
window.clearInterval(checkerInterval)
checkIfWindowMaximized()
checkerInterval = window.setInterval(() => {
checkIfWindowMaximized()
}, 300)
}, 100)
})
/**

View file

@ -13,6 +13,7 @@ const routes: RouteRecordRaw[] = [
/**
* Component testing pathing
* ONLY for singular component testing purposes
*/
{
path: '/componentTesting/:componentName',
@ -23,6 +24,7 @@ const routes: RouteRecordRaw[] = [
},
/**
* Error page - 404
* Always leave this as last one, but you can also remove it
*/
{