about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/api/debug-appview-proxy-header.ts4
-rw-r--r--src/lib/notifications/notifications.ts9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/api/debug-appview-proxy-header.ts b/src/lib/api/debug-appview-proxy-header.ts
index 7571bd37f..44363cde2 100644
--- a/src/lib/api/debug-appview-proxy-header.ts
+++ b/src/lib/api/debug-appview-proxy-header.ts
@@ -10,7 +10,6 @@
 
 import {useState, useCallback, useEffect} from 'react'
 import {BskyAgent} from '@atproto/api'
-import {isWeb} from 'platform/detection'
 import * as Storage from 'lib/storage'
 
 export function useDebugHeaderSetting(agent: BskyAgent): [boolean, () => void] {
@@ -51,9 +50,6 @@ export function setDebugHeader(agent: BskyAgent, enabled: boolean) {
 }
 
 export async function applyDebugHeader(agent: BskyAgent) {
-  if (!isWeb) {
-    return
-  }
   if (await isEnabled()) {
     agent.api.xrpc.setHeader('x-appview-proxy', 'true')
   }
diff --git a/src/lib/notifications/notifications.ts b/src/lib/notifications/notifications.ts
index 88ebed044..dfc9a42b1 100644
--- a/src/lib/notifications/notifications.ts
+++ b/src/lib/notifications/notifications.ts
@@ -61,10 +61,13 @@ export function init(store: RootStoreModel) {
     })
   })
 
-  // handle notifications that are tapped on, regardless of whether the app is in the foreground or background
+  // handle notifications that are received, both in the foreground or background
   Notifications.addNotificationReceivedListener(event => {
     store.log.debug('Notifications: received', event)
     if (event.request.trigger.type === 'push') {
+      // refresh notifications in the background
+      store.me.notifications.syncQueue()
+      // handle payload-based deeplinks
       let payload
       if (isIOS) {
         payload = event.request.trigger.payload
@@ -78,6 +81,7 @@ export function init(store: RootStoreModel) {
     }
   })
 
+  // handle notifications that are tapped on
   const sub = Notifications.addNotificationResponseReceivedListener(
     response => {
       store.log.debug(
@@ -91,7 +95,8 @@ export function init(store: RootStoreModel) {
           'User pressed a notification, opening notifications tab',
         )
         track('Notificatons:OpenApp')
-        resetToTab('NotificationsTab')
+        store.me.notifications.refresh() // refresh notifications
+        resetToTab('NotificationsTab') // open notifications tab
       }
     },
   )