Skip to content

Commit 3ae870a

Browse files
committed
simplify
1 parent d4d295f commit 3ae870a

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/site-kit/src/lib/nav/Menu.svelte

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,13 @@
3030
3131
afterNavigate(onclose);
3232
33-
function mounted(_: HTMLElement, fn: (current: boolean) => void) {
33+
$effect(() => {
3434
// this is necessary to ensure that the menu-background height
3535
// is applied without an animation
3636
setTimeout(() => {
37-
fn(true);
37+
ready = true;
3838
});
39-
40-
return {
41-
destroy() {
42-
fn(false);
43-
}
44-
};
45-
}
39+
});
4640
4741
function slide(node: HTMLElement, { duration = 400, easing = expoOut } = {}): TransitionConfig {
4842
const height = current ? node.clientHeight : universal_menu_inner_height;
@@ -69,7 +63,6 @@
6963
class:ready
7064
style:height={show_context_menu ? '99%' : `${universal_menu_inner_height}px`}
7165
style:--background={show_context_menu ? 'var(--sk-back-3)' : null}
72-
use:mounted={(mounted) => (ready = mounted)}
7366
></div>
7467

7568
<div

0 commit comments

Comments
 (0)