mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
don't crash when tracked user is not there
This commit is contained in:
parent
fef6586e5b
commit
d43cdfd889
@ -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);
|
||||||
user.deviceTrackingStatus = TRACKING_STATUS_OUTDATED;
|
if (user) {
|
||||||
userIdentities.set(user);
|
user.deviceTrackingStatus = TRACKING_STATUS_OUTDATED;
|
||||||
|
userIdentities.set(user);
|
||||||
|
} else {
|
||||||
|
console.warn("changed device userid not found", userId);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user