add handling of more event types

This commit is contained in:
missmeowness 2023-05-02 18:04:08 +03:00
parent 2d964e9786
commit f19123c2cf
2 changed files with 37 additions and 0 deletions

View File

@ -11,6 +11,38 @@
<mat-divider></mat-divider>
</mat-list>
<mat-list >
<div mat-subheader>Text</div>
<mat-list-item *ngFor="let state of state.events.shortTextNote | keyvalue">
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle>{{state.key}}</div>
<div matListItemLine>{{state.value.content}}</div>
</mat-list-item>
<mat-divider></mat-divider>
</mat-list>
<mat-list >
<div mat-subheader>Contacts</div>
<mat-list-item *ngFor="let state of state.events.contacts | keyvalue">
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle>{{state.key}}</div>
<div matListItemLine>{{state.value.content}}</div>
</mat-list-item>
<mat-divider></mat-divider>
</mat-list>
<mat-list >
<div mat-subheader>Reactions</div>
<mat-list-item *ngFor="let state of state.events.reaction | keyvalue">
<mat-icon matListItemIcon>folder</mat-icon>
<div matListItemTitle>{{state.key}}</div>
<div matListItemLine>{{state.value.content}}</div>
</mat-list-item>
<mat-divider></mat-divider>
</mat-list>
State as JSON:<br>
{{ state | json }}

View File

@ -17,6 +17,11 @@ export class StateService {
case Kind.Text:
this.addIfMissing(event, this.state.events.shortTextNote);
break;
case Kind.Contacts:
this.addIfNewer(event, event.pubkey, this.state.events.contacts);
break;
case Kind.Reaction:
this.addIfNewer(event, event.content, this.state.events.reaction)
}
}