11<template >
2- <main class =" overflow-hidden relative w-screen h-screen" >
2+ <main
3+ class =" overflow-hidden relative w-screen h-screen"
4+ :class =" { animationsDisabled: 'disable-animations' }"
5+ >
36 <!-- Decoration -->
47 <div
58 class =" gradient-ball absolute -z-10 left-0 bottom-0 translate-x-[-50%] translate-y-[50%] w-[90vw] aspect-square opacity-15 blob-anim"
1114 <!-- Stripes for experimental -->
1215 <div
1316 v-show =" wbConfig?.config.experimentalFeatures"
14- :key =" rerenderCounter"
1517 class =" experimental-stripes absolute top-0 left-0 w-full h-[3rem] pointer-events-none z-[10] opacity-15 grayscale"
1618 ></div >
1719
138140 {{ useRoute().name }}
139141 </h1 >
140142 </div >
141- <router-view v-slot =" { Component }" @rerender = " rerenderCounter++ " >
143+ <router-view v-slot =" { Component }" >
142144 <transition mode =" out-in" name =" fade" >
143145 <component :is =" Component" />
144146 </transition >
156158import { RouteRecordRaw , RouterLink , useRoute , useRouter } from " vue-router" ;
157159import { routes } from " ./router" ;
158160import { Icon } from " @iconify/vue" ;
159- import { onMounted , onUnmounted , ref , useTemplateRef , watch } from " vue" ;
161+ import { onMounted , ref , useTemplateRef , watch , reactive , computed } from " vue" ;
160162import { isInstalled } from " ./lib/install" ;
161163import { Winboat } from " ./lib/winboat" ;
162164import { openAnchorLink } from " ./utils/openLink" ;
163165import { WinboatConfig } from " ./lib/config" ;
164166import { USBManager } from " ./lib/usbmanager" ;
165- import { setIntervalImmediately } from " ./utils/interval" ;
166167import { CommonPorts , getActiveHostPort } from " ./lib/containers/common" ;
167168import { performAutoMigrations } from " ./lib/migrate" ;
168169const { BrowserWindow }: typeof import (" @electron/remote" ) = require (" @electron/remote" );
@@ -179,16 +180,15 @@ let updateTimeout: NodeJS.Timeout | null = null;
179180const manualUpdateRequired = ref (false );
180181const MANUAL_UPDATE_TIMEOUT = 60000 ; // 60 seconds
181182const updateDialog = useTemplateRef (" updateDialog" );
182- // TODO: Hack for non-reactive data
183- const rerenderCounter = ref (0 );
184183const novncURL = ref (" " );
185- let animationCheckInterval: NodeJS .Timeout | null = null ;
184+
185+ const animationsDisabled = computed (() => wbConfig ?.config .disableAnimations );
186186
187187onMounted (async () => {
188188 const winboatInstalled = await isInstalled ();
189189
190190 if (winboatInstalled ) {
191- wbConfig = WinboatConfig .getInstance (); // Instantiate singleton class
191+ wbConfig = reactive ( WinboatConfig .getInstance () ); // Instantiate singleton class
192192 winboat = Winboat .getInstance (); // Instantiate singleton class
193193 USBManager .getInstance (); // Instantiate singleton class
194194
@@ -202,30 +202,6 @@ onMounted(async () => {
202202 console .log (" Not installed, redirecting to setup..." );
203203 $router .push (" /setup" );
204204 }
205-
206- // Apply or remove disable-animations class based on config
207- const updateAnimationClass = () => {
208- if (wbConfig ?.config .disableAnimations ) {
209- document .body .classList .add (" disable-animations" );
210- console .log (" Animations disabled" );
211- } else {
212- document .body .classList .remove (" disable-animations" );
213- console .log (" Animations enabled" );
214- }
215- };
216-
217- // Poll for config changes since the Proxy doesn't trigger Vue reactivity
218- // This is similar to how rerenderCounter is used elsewhere in the codebase
219- // Start with undefined so that the first call will always apply the current state
220- let lastAnimationState: boolean | undefined = undefined ;
221- animationCheckInterval = setIntervalImmediately (() => {
222- const currentState = wbConfig ?.config .disableAnimations ;
223- if (currentState !== lastAnimationState ) {
224- lastAnimationState = currentState ;
225- updateAnimationClass ();
226- rerenderCounter .value ++ ; // Force re-render to update transitions
227- }
228- }, 1000 ); // Check every 1000ms
229205
230206 // Watch for guest server updates and show dialog
231207 watch (
@@ -250,13 +226,6 @@ onMounted(async () => {
250226 );
251227});
252228
253- onUnmounted (() => {
254- // Clean up the interval when component unmounts
255- if (animationCheckInterval ) {
256- clearInterval (animationCheckInterval );
257- }
258- });
259-
260229function handleMinimize() {
261230 console .log (" Minimize" );
262231 window .electronAPI .minimizeWindow ();
0 commit comments