mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
use same code to add room to identity in migration as in device tracker
This commit is contained in:
parent
a437332482
commit
0d6ae19d99
@ -123,17 +123,9 @@ export class DeviceTracker {
|
||||
async _writeMember(member, txn) {
|
||||
const {userIdentities} = txn;
|
||||
const identity = await userIdentities.get(member.userId);
|
||||
if (!identity) {
|
||||
userIdentities.set({
|
||||
userId: member.userId,
|
||||
roomIds: [member.roomId],
|
||||
deviceTrackingStatus: TRACKING_STATUS_OUTDATED,
|
||||
});
|
||||
} else {
|
||||
if (!identity.roomIds.includes(member.roomId)) {
|
||||
identity.roomIds.push(member.roomId);
|
||||
userIdentities.set(identity);
|
||||
}
|
||||
const updatedIdentity = addRoomToIdentity(identity, member.userId, member.roomId);
|
||||
if (updatedIdentity) {
|
||||
userIdentities.set(updatedIdentity);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user