mirror of
https://github.com/block-core/blockcore-notes.git
synced 2024-09-29 22:40:44 +00:00
add handling of more event types
This commit is contained in:
parent
2d964e9786
commit
f19123c2cf
@ -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 }}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user