Skip to content

Commit 97041ab

Browse files
committed
feat: notifications logger
1 parent 079043f commit 97041ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

apps/main/src/init.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { getIconPath } from "./helper"
1212
import { t } from "./lib/i18n"
1313
import { store } from "./lib/store"
1414
import { updateNotificationsToken } from "./lib/user"
15+
import { logger } from "./logger"
1516
import { registerAppMenu } from "./menu"
1617
import type { RendererHandlers } from "./renderer-handlers"
1718
import { initializeSentry } from "./sentry"
@@ -154,12 +155,15 @@ const registerPushNotifications = async () => {
154155
persistentIds: persistentIds || [],
155156
credentials,
156157
})
158+
logger.info(`PushReceiver initialized with token ${credentials?.fcm?.token}`)
157159

158160
instance.onCredentialsChanged(({ newCredentials }) => {
161+
logger.info(`PushReceiver credentials changed to ${newCredentials?.fcm?.token}`)
159162
updateNotificationsToken(newCredentials)
160163
})
161164

162165
instance.onNotification((notification) => {
166+
logger.info(`PushReceiver received notification: ${JSON.stringify(notification.message.data)}`)
163167
const data = notification.message.data as MessagingData
164168
switch (data.type) {
165169
case "new-entry": {

0 commit comments

Comments
 (0)