diff --git a/src/hooks/useUpdate.ts b/src/hooks/useUpdate.ts index b099b1ce..6b802566 100644 --- a/src/hooks/useUpdate.ts +++ b/src/hooks/useUpdate.ts @@ -24,7 +24,7 @@ const checkForUpdate = async () => { logAndToastError('Failed to install update: Make sure your app has been installed to the applications folder and the app is opened from there. If you continue to have trouble, reach out to paul@ebb.cool', error) } else { logAndToastError('Failed to check for updates', error) - throw error + // Don't throw - just log and continue to prevent unhandled rejections } } return null diff --git a/src/hooks/useWorkerPolling.ts b/src/hooks/useWorkerPolling.ts index 93410b5b..2439d24a 100644 --- a/src/hooks/useWorkerPolling.ts +++ b/src/hooks/useWorkerPolling.ts @@ -10,6 +10,7 @@ import { invoke } from '@tauri-apps/api/core' import { SmartSessionApi } from '@/api/ebbApi/smartSessionApi' import { ScheduledSessionExecutionApi } from '@/api/ebbApi/scheduledSessionExecutionApi' import { useAuth } from './useAuth' +import { debug } from '@tauri-apps/plugin-log' type OnlinePingEvent = { event: string @@ -90,7 +91,11 @@ export const useWorkerPolling = () => { setupListener() return () => { - unlisten?.() + try { + unlisten?.() + } catch (error) { + debug(`[useWorkerPolling] Failed to unlisten online-ping event: ${error}`) + } } }, [profile, isLoading, updateRollupForUser, deviceId, user]) diff --git a/src/lib/stores/connectedStore.ts b/src/lib/stores/connectedStore.ts index bd076f02..029bae8f 100644 --- a/src/lib/stores/connectedStore.ts +++ b/src/lib/stores/connectedStore.ts @@ -1,5 +1,4 @@ import { create } from 'zustand' -import { Duration } from 'luxon' interface ConnectedStore { connected: boolean @@ -10,8 +9,3 @@ export const useConnectedStore = create((set) => ({ connected: false, setConnected: (connected) => set({ connected }) })) - -export const getDurationFromDefault = (minutes: number | null) => { - if (!minutes) return null - return Duration.fromObject({ minutes }) -}