moved cleanup out of mount

This commit is contained in:
Xanazf 2024-10-18 00:05:06 +03:00
parent 33d3ce46c4
commit eeb2b46f76
Signed by: Xanazf
GPG key ID: 4E4A5AD1FB748427
2 changed files with 6 additions and 8 deletions
src/components/navigation/sidebars

View file

@ -47,11 +47,10 @@ const NavComponent: Component<NavProps> = props => {
}
};
onMount(() => {
onMount(() => {});
onCleanup(() => {
window.removeEventListener("click", handleClickOutside);
});
});
createEffect(() => {
if (open()) {

View file

@ -40,11 +40,10 @@ const TableOfContents: Component<TOCProps> = props => {
}
};
onMount(() => {
onMount(() => {});
onCleanup(() => {
window.removeEventListener("click", handleClickOutside);
});
});
createEffect(() => {
if (open()) {