From afc6cce5b194f6bcf0af4986527a7627a6eba5c5 Mon Sep 17 00:00:00 2001 From: Lilian Date: Wed, 10 Jul 2024 19:34:17 +0200 Subject: [PATCH] [frontend] Allow opening profile from follow notification --- .../Components/NotificationComponent.razor | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Iceshrimp.Frontend/Components/NotificationComponent.razor b/Iceshrimp.Frontend/Components/NotificationComponent.razor index a712a4dc..e9858556 100644 --- a/Iceshrimp.Frontend/Components/NotificationComponent.razor +++ b/Iceshrimp.Frontend/Components/NotificationComponent.razor @@ -28,7 +28,7 @@ @if (NotificationResponse is { Type: "follow", User: not null }) { - @Loc["Followed you."] + @Loc["Followed you."] } @if (NotificationResponse is { Type: "followRequestReceived" }) { @@ -78,4 +78,11 @@ { NavigationManager.NavigateTo("/follow-requests"); } + + private void OpenProfile() + { + var username = $"@{NotificationResponse.User?.Username}"; + if (NotificationResponse.User?.Host != null) username += $"@{NotificationResponse.User.Host}"; + NavigationManager.NavigateTo($"/{username}"); + } } \ No newline at end of file