forked from mystiq/hydrogen-web
remove extra layer of log items
This commit is contained in:
parent
a072426e07
commit
d1dc4c9e9c
1 changed files with 23 additions and 26 deletions
|
@ -77,8 +77,8 @@ export class Invite extends EventEmitter {
|
||||||
|
|
||||||
async writeSync(membership, roomResponse, txn, log) {
|
async writeSync(membership, roomResponse, txn, log) {
|
||||||
if (membership === "invite") {
|
if (membership === "invite") {
|
||||||
return log.wrap("new invite", async log => {
|
|
||||||
log.set("id", this.id);
|
log.set("id", this.id);
|
||||||
|
log.set("add", true);
|
||||||
const inviteState = roomResponse["invite_state"]?.events;
|
const inviteState = roomResponse["invite_state"]?.events;
|
||||||
if (!Array.isArray(inviteState)) {
|
if (!Array.isArray(inviteState)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -96,14 +96,11 @@ export class Invite extends EventEmitter {
|
||||||
const inviteData = this._createData(inviteState, myInvite, inviter, summaryData, heroes);
|
const inviteData = this._createData(inviteState, myInvite, inviter, summaryData, heroes);
|
||||||
txn.invites.set(inviteData);
|
txn.invites.set(inviteData);
|
||||||
return {inviteData, inviter};
|
return {inviteData, inviter};
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
return log.wrap("remove invite", log => {
|
|
||||||
log.set("id", this.id);
|
log.set("id", this.id);
|
||||||
log.set("membership", membership);
|
log.set("membership", membership);
|
||||||
txn.invites.remove(this.id);
|
txn.invites.remove(this.id);
|
||||||
return null;
|
return null;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue