diff --git a/ImageBoardServerApp/Pages/Basic/RedirectTo.razor b/ImageBoardServerApp/Pages/Basic/RedirectTo.razor new file mode 100644 index 0000000..073286c --- /dev/null +++ b/ImageBoardServerApp/Pages/Basic/RedirectTo.razor @@ -0,0 +1,19 @@ +@page "/sys/click/red/{loc}" +@using System.ComponentModel.DataAnnotations +@inject NavigationManager navManager +

Redirecting...

+ +@code { + + [Parameter] + [Required] + public string loc { get; set; } + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + var p = loc.Replace("_", "/"); + navManager.NavigateTo(p, true, true); + await base.OnAfterRenderAsync(firstRender); + } + +} \ No newline at end of file diff --git a/ImageBoardServerApp/Shared/Components/Comment.razor b/ImageBoardServerApp/Shared/Components/Comment.razor index a397fbb..49f8597 100644 --- a/ImageBoardServerApp/Shared/Components/Comment.razor +++ b/ImageBoardServerApp/Shared/Components/Comment.razor @@ -4,6 +4,8 @@ @using System.Text.RegularExpressions @using System.ComponentModel.DataAnnotations @inject AuthenticationStateProvider authStateProvider +@inject NavigationManager navigationManager; +
[ @@ -132,6 +134,7 @@ if (foundusr.Role != "User" || comment.UserID == foundusr.UserID) { await TheManager.deleteComment(comment); + navigationManager.NavigateTo($"/sys/click/red/_{comment.Board}_thread_{comment.PostID}"); } } diff --git a/ImageBoardServerApp/Shared/Components/Post.razor b/ImageBoardServerApp/Shared/Components/Post.razor index 79d0541..0d60d1f 100644 --- a/ImageBoardServerApp/Shared/Components/Post.razor +++ b/ImageBoardServerApp/Shared/Components/Post.razor @@ -149,22 +149,6 @@
@code { - /* - private RenderFragment[] RenderWithAnchorTags(string input) - { - return input.Split(' ').Select(e => e.StartsWith("https://") || e.StartsWith("http://") - ? (RenderFragment)(builder => - { - builder.OpenElement(0, "a"); - builder.AddAttribute(1, "href", e); - builder.AddContent(2, e); - builder.CloseElement(); - }) - : (RenderFragment)(builder => builder.AddContent(0, e))).ToArray(); - } - */ - - private string reportURL { get; set; } private string threadURL { get; set; } private string openThreadName { get; set; } @@ -203,7 +187,7 @@ if (foundusr.Role != "User" || post.UserID == foundusr.UserID) { await TheManager.deleteThread(post); - navigationManager.NavigateTo($"/{boardTag}"); + navigationManager.NavigateTo($"/sys/click/red/_{boardTag}"); } }