[frontend] Allow opening profile from follow notification
This commit is contained in:
parent
0dd79abca9
commit
afc6cce5b1
1 changed files with 8 additions and 1 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
@if (NotificationResponse is { Type: "follow", User: not null })
|
@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" })
|
@if (NotificationResponse is { Type: "followRequestReceived" })
|
||||||
{
|
{
|
||||||
|
@ -78,4 +78,11 @@
|
||||||
{
|
{
|
||||||
NavigationManager.NavigateTo("/follow-requests");
|
NavigationManager.NavigateTo("/follow-requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OpenProfile()
|
||||||
|
{
|
||||||
|
var username = $"@{NotificationResponse.User?.Username}";
|
||||||
|
if (NotificationResponse.User?.Host != null) username += $"@{NotificationResponse.User.Host}";
|
||||||
|
NavigationManager.NavigateTo($"/{username}");
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue