forked from mystiq/hydrogen-web
don't crash when tracked user is not there
This commit is contained in:
parent
fef6586e5b
commit
d43cdfd889
1 changed files with 7 additions and 3 deletions
|
@ -47,9 +47,13 @@ export class DeviceTracker {
|
||||||
const {userIdentities} = txn;
|
const {userIdentities} = txn;
|
||||||
if (Array.isArray(deviceLists.changed) && deviceLists.changed.length) {
|
if (Array.isArray(deviceLists.changed) && deviceLists.changed.length) {
|
||||||
await Promise.all(deviceLists.changed.map(async userId => {
|
await Promise.all(deviceLists.changed.map(async userId => {
|
||||||
const user = await userIdentities.get(userId)
|
const user = await userIdentities.get(userId);
|
||||||
|
if (user) {
|
||||||
user.deviceTrackingStatus = TRACKING_STATUS_OUTDATED;
|
user.deviceTrackingStatus = TRACKING_STATUS_OUTDATED;
|
||||||
userIdentities.set(user);
|
userIdentities.set(user);
|
||||||
|
} else {
|
||||||
|
console.warn("changed device userid not found", userId);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue