Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/push/send.js
Show First 20 Lines • Show All 590 Lines • ▼ Show 20 Lines | ): Map<Platform, Map<number, Set<string>>> { | ||||
const byPlatform = new Map(); | const byPlatform = new Map(); | ||||
for (const device of devices) { | for (const device of devices) { | ||||
let innerMap = byPlatform.get(device.platform); | let innerMap = byPlatform.get(device.platform); | ||||
if (!innerMap) { | if (!innerMap) { | ||||
innerMap = new Map(); | innerMap = new Map(); | ||||
byPlatform.set(device.platform, innerMap); | byPlatform.set(device.platform, innerMap); | ||||
} | } | ||||
const codeVersion: number = | const codeVersion: number = | ||||
device.codeVersion !== null && device.codeVersion !== undefined | device.codeVersion !== null && | ||||
device.codeVersion !== undefined && | |||||
device.platform !== 'windows' && | |||||
device.platform !== 'macos' | |||||
? device.codeVersion | ? device.codeVersion | ||||
: -1; | : -1; | ||||
let innerMostSet = innerMap.get(codeVersion); | let innerMostSet = innerMap.get(codeVersion); | ||||
if (!innerMostSet) { | if (!innerMostSet) { | ||||
innerMostSet = new Set(); | innerMostSet = new Set(); | ||||
innerMap.set(codeVersion, innerMostSet); | innerMap.set(codeVersion, innerMostSet); | ||||
} | } | ||||
innerMostSet.add(device.deviceToken); | innerMostSet.add(device.deviceToken); | ||||
▲ Show 20 Lines • Show All 593 Lines • Show Last 20 Lines |