[frontend] Allow opening profile from follow notification

This commit is contained in:
Lilian 2024-07-10 19:34:17 +02:00
parent 0dd79abca9
commit afc6cce5b1
No known key found for this signature in database

View file

@ -28,7 +28,7 @@
@if (NotificationResponse is { Type: "follow", User: not null })
{
<span class="notification-text">@Loc["Followed you."]</span>
<span @onclick="OpenProfile" class="notification-text">@Loc["Followed you."]</span>
}
@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}");
}
}