Skip to content

Commit 0eb2e1b

Browse files
committed
fix: fixed the registration issue.
1 parent fc9eb34 commit 0eb2e1b

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

infrastructure/eid-wallet/src/routes/(app)/main/+page.svelte

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)