Skip to content

Commit 7444a81

Browse files
committed
check user in task
1 parent 5b85a8d commit 7444a81

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

apps/mobile/src/initialize/background.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ import { whoami } from "../store/user/getters"
77
const BACKGROUND_FETCH_TASK = "background-fetch"
88

99
export async function initBackgroundFetch() {
10-
const user = whoami()
11-
if (!user) {
12-
return
13-
}
14-
1510
TaskManager.defineTask(BACKGROUND_FETCH_TASK, async () => {
1611
// const now = Date.now()
1712
// console.log(`Got background fetch call at date: ${new Date(now).toISOString()}`)
13+
const user = whoami()
14+
if (!user) {
15+
return BackgroundFetch.BackgroundFetchResult.NoData
16+
}
1817

1918
try {
2019
const res = await unreadSyncService.updateBadgeAtBackground()

0 commit comments

Comments
 (0)