We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da6bd0b commit 8ab675dCopy full SHA for 8ab675d
src/frontend/src/routes/(new-styling)/+page.svelte
@@ -66,15 +66,19 @@
66
},
67
];
68
69
- onMount(async () => {
70
- setTimeout(
71
- async () =>
72
- await triggerDropWaveAnimation({ containerHeight: "h-[640px]" }),
73
- );
74
- });
75
-
76
- onDestroy(() => {
77
- void clearDropWaveAnimation();
+ // Only trigger the drop wave animation 100ms after the page has loaded,
+ // so we can cancel it if navigated to another route in that time window.
+ onMount(() => {
+ let cancelled = false;
+ setTimeout(() => {
+ if (!cancelled) {
+ void triggerDropWaveAnimation({ containerHeight: "h-[640px]" });
+ }
+ }, 100);
78
+ return () => {
79
+ cancelled = true;
80
+ void clearDropWaveAnimation();
81
+ };
82
});
83
</script>
84
0 commit comments