feat(dates): wire pruneDeadTokens into onDateHistoryCreated
This commit is contained in:
parent
f8240e01a9
commit
2aa08efd39
|
|
@ -1,6 +1,7 @@
|
|||
import * as functions from 'firebase-functions'
|
||||
import * as admin from 'firebase-admin'
|
||||
import { recipientInQuietHours } from '../notifications/quietHours'
|
||||
import { pruneDeadTokens } from '../notifications/pruneTokens'
|
||||
|
||||
/**
|
||||
* Fires when a date is logged as completed (`couples/{coupleId}/date_history/{dateId}` created). Nudges
|
||||
|
|
@ -58,4 +59,5 @@ export const onDateHistoryCreated = functions.firestore
|
|||
results.forEach((r, i) => {
|
||||
if (r.status === 'rejected') console.warn(`[onDateHistoryCreated] FCM failed for ${tokens[i]}:`, r.reason)
|
||||
})
|
||||
await pruneDeadTokens(db, partnerId, tokens, results)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue