Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Guard around SpaceStore onAccountData handler prevEvent (#7123)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Nov 12, 2021
1 parent 98ea2c3 commit a16e6da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stores/spaces/SpaceStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,9 @@ export class SpaceStoreClass extends AsyncStoreWithClient<IState> {
}
};

private onAccountData = (ev: MatrixEvent, lastEvent: MatrixEvent) => {
private onAccountData = (ev: MatrixEvent, prevEvent?: MatrixEvent) => {
if (!this.allRoomsInHome && ev.getType() === EventType.Direct) {
const lastContent = lastEvent.getContent();
const lastContent = prevEvent?.getContent() ?? {};
const content = ev.getContent();

const diff = objectDiff<Record<string, string[]>>(lastContent, content);
Expand Down

0 comments on commit a16e6da

Please sign in to comment.