From 8c0627ff272f46f0f9943543e66276b296af6258 Mon Sep 17 00:00:00 2001 From: reya <123083837+reyamir@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:14:03 +0700 Subject: [PATCH] fix: crash on startup --- apps/desktop2/src/routes/$account.home.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/desktop2/src/routes/$account.home.tsx b/apps/desktop2/src/routes/$account.home.tsx index 594944128..742ab2dc4 100644 --- a/apps/desktop2/src/routes/$account.home.tsx +++ b/apps/desktop2/src/routes/$account.home.tsx @@ -104,9 +104,9 @@ function Screen() { } return () => { - emblaApi.off("scroll", emitScrollEvent); - emblaApi.off("resize", emitResizeEvent); - emblaApi.off("slidesChanged", emitScrollEvent); + emblaApi?.off("scroll", emitScrollEvent); + emblaApi?.off("resize", emitResizeEvent); + emblaApi?.off("slidesChanged", emitScrollEvent); }; }, [emblaApi, emitScrollEvent, emitResizeEvent]);