mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-01 12:26:08 +08:00
chore: stop using old device array
This commit is contained in:
parent
b15e8d2be1
commit
d62da2fca2
2 changed files with 2 additions and 7 deletions
|
@ -458,7 +458,7 @@ const recipientClickhouseQuery = async (campaign: Campaign) => {
|
|||
} else if (campaign.channel === 'text') {
|
||||
return "(users.phone != '' AND users.phone IS NOT NULL)"
|
||||
} else if (campaign.channel === 'push') {
|
||||
return '((users.devices IS NOT NULL AND NOT empty(users.devices)) OR users.has_push_device = 1)'
|
||||
return '(users.has_push_device = 1)'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
|
|
@ -18,12 +18,7 @@ export default class PushChannel {
|
|||
async send(template: PushTemplate, devices: PushDevice[], variables: Variables): Promise<PushResponse | undefined> {
|
||||
|
||||
// Find tokens from active devices with push enabled
|
||||
// Temporarily include the old table
|
||||
const oldDevices = variables.user?.devices?.filter(device => device.token != null) as PushDevice[] ?? []
|
||||
const tokens: string[] = [...new Set([
|
||||
...devices.map(device => device.token),
|
||||
...oldDevices.map(device => device.token),
|
||||
])]
|
||||
const tokens = devices.map(device => device.token)
|
||||
|
||||
const push = {
|
||||
tokens,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue