A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: fix event subscription
Ammar Ahmedbf536eb18311
diff --git a/apps/mobile/app/hooks/use-app-events.tsx b/apps/mobile/app/hooks/use-app-events.tsxindex 79abc6a63..84bbd2e22 100644--- a/apps/mobile/app/hooks/use-app-events.tsx+++ b/apps/mobile/app/hooks/use-app-events.tsx@@ -840,7 +840,13 @@ export const useAppEvents = () => {return () => {emitterSubscriptions.forEach((sub) => sub?.remove?.());- subscriptions.forEach((sub) => sub?.unsubscribe?.());+ subscriptions.forEach((sub) => {+ if (Array.isArray(sub)) {+ sub.forEach((s) => s.unsubscribe());+ } else {+ sub?.unsubscribe?.();+ }+ });};}, [onSyncComplete, onUserUpdated]);