Fix bug with links on notifications

- Fix "note" link on notifications which was not linking correctly.
- Fix the "Replying to" links.
This commit is contained in:
SondreB 2023-02-19 01:44:47 +01:00
parent f825f8ca3e
commit a500d475b8
No known key found for this signature in database
GPG Key ID: D6CC44C75005FDBF
4 changed files with 9 additions and 3 deletions

View File

@ -276,6 +276,9 @@ export interface NotificationModel {
/** The event ID of the notification */
id: string;
/** The ID of event a reaction responds to. */
relatedId?: string;
pubkey: string;
message: string;

View File

@ -456,8 +456,11 @@ export class RelayService {
msg = `Event kind ${event.kind} notification.`;
}
const lastETag = this.eventService.lastETag(event);
notification = {
id: event.id!,
relatedId: lastETag,
kind: event.kind,
pubkey: event.pubkey,
message: msg,

View File

@ -2,5 +2,5 @@
<span *ngIf="notification.kind > 7"> {{ notification.message }}</span>
<span *ngIf="notification.kind == 1"> replied to your <a [routerLink]="['/e', notification.id]">note</a>.</span>
<span *ngIf="notification.kind == 3"> started following you.</span>
<span *ngIf="notification.kind == 6"> boosted your <a [routerLink]="['/e', notification.id]">note</a></span>
<span *ngIf="notification.kind == 7"> reacted with {{notification.message}} to your <a [routerLink]="['/e', notification.id]">note</a>.</span>
<span *ngIf="notification.kind == 6"> boosted your <a [routerLink]="['/e', notification.relatedId]">note</a></span>
<span *ngIf="notification.kind == 7"> reacted with {{notification.message}} to your <a [routerLink]="['/e', notification.relatedId]">note</a>.</span>

View File

@ -32,7 +32,7 @@ export class ReplyListComponent {
const profile = await this.profileService.getProfile(key);
if (profile) {
this.profiles.push({ pubkey: profile.pubKey, name: profile.name });
this.profiles.push({ pubkey: profile.pubkey, name: profile.name });
} else {
this.profiles.push({ pubkey: key, name: key });
}