File tree Expand file tree Collapse file tree
infrastructure/eid-wallet/src/routes/(app)/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -542,17 +542,20 @@ const scanFABVisible = $derived(tourStep === null || tourStep === "scan");
542542// during earlier steps, and after FINISH.
543543$effect (() => {
544544 if (typeof window === " undefined" ) return ;
545- if (tourStep !== " scan" ) {
546- scanFABTop = restingScanFABTop ();
545+ const handleViewPortChange = () => {
546+ if (tourStep !== " scan" ) {
547+ scanFABTop = restingScanFABTop ();
548+ }
547549 }
550+ handleViewPortChange ()
548551 // Attach listeners for both orientation change and general window resize
549- window .addEventListener (" orientationchange" , () => scanFABTop = restingScanFABTop () );
550- window .addEventListener (" resize" , () => scanFABTop = restingScanFABTop () );
552+ window .addEventListener (" orientationchange" , handleViewPortChange );
553+ window .addEventListener (" resize" , handleViewPortChange );
551554
552555 // Clean up event listeners when the component is unmounted
553556 return () => {
554- window .removeEventListener (" orientationchange" , () => scanFABTop = restingScanFABTop () );
555- window .removeEventListener (" resize" , () => scanFABTop = restingScanFABTop () );
557+ window .removeEventListener (" orientationchange" , handleViewPortChange );
558+ window .removeEventListener (" resize" , handleViewPortChange );
556559 };
557560});
558561
You can’t perform that action at this time.
0 commit comments