Skip to content

Commit 541a823

Browse files
committed
Cleanup a couple sentry errors
1 parent 2d212d2 commit 541a823

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/hooks/useUpdate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const checkForUpdate = async () => {
2424
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 [email protected]', error)
2525
} else {
2626
logAndToastError('Failed to check for updates', error)
27-
throw error
27+
// Don't throw - just log and continue to prevent unhandled rejections
2828
}
2929
}
3030
return null

src/hooks/useWorkerPolling.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { invoke } from '@tauri-apps/api/core'
1010
import { SmartSessionApi } from '@/api/ebbApi/smartSessionApi'
1111
import { ScheduledSessionExecutionApi } from '@/api/ebbApi/scheduledSessionExecutionApi'
1212
import { useAuth } from './useAuth'
13+
import { debug } from '@tauri-apps/plugin-log'
1314

1415
type OnlinePingEvent = {
1516
event: string
@@ -90,7 +91,11 @@ export const useWorkerPolling = () => {
9091
setupListener()
9192

9293
return () => {
93-
unlisten?.()
94+
try {
95+
unlisten?.()
96+
} catch (error) {
97+
debug(`[useWorkerPolling] Failed to unlisten online-ping event: ${error}`)
98+
}
9499
}
95100
}, [profile, isLoading, updateRollupForUser, deviceId, user])
96101

src/lib/stores/connectedStore.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { create } from 'zustand'
2-
import { Duration } from 'luxon'
32

43
interface ConnectedStore {
54
connected: boolean
@@ -10,8 +9,3 @@ export const useConnectedStore = create<ConnectedStore>((set) => ({
109
connected: false,
1110
setConnected: (connected) => set({ connected })
1211
}))
13-
14-
export const getDurationFromDefault = (minutes: number | null) => {
15-
if (!minutes) return null
16-
return Duration.fromObject({ minutes })
17-
}

0 commit comments

Comments
 (0)