Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hooks/useUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/hooks/useWorkerPolling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])

Expand Down
6 changes: 0 additions & 6 deletions src/lib/stores/connectedStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { create } from 'zustand'
import { Duration } from 'luxon'

interface ConnectedStore {
connected: boolean
Expand All @@ -10,8 +9,3 @@ export const useConnectedStore = create<ConnectedStore>((set) => ({
connected: false,
setConnected: (connected) => set({ connected })
}))

export const getDurationFromDefault = (minutes: number | null) => {
if (!minutes) return null
return Duration.fromObject({ minutes })
}