Skip to content

Commit

Permalink
Count also blog post visits when clicking on internal link
Browse files Browse the repository at this point in the history
Fixes #325
  • Loading branch information
linkdotnet committed Apr 9, 2024
1 parent c5b4163 commit 5e5c947
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,12 @@ else
isLoading = true;
BlogPost = await BlogPostRepository.GetByIdAsync(BlogPostId);
isLoading = false;
_ = UserRecordService.StoreUserRecordAsync();
}

protected override async Task OnAfterRenderAsync(bool firstRender)
{
await JsRuntime.InvokeVoidAsync("hljs.highlightAll");

if (firstRender)
{
var userRecordTask = UserRecordService.StoreUserRecordAsync();
StateHasChanged();
await userRecordTask;
}
}

private async Task UpdateLikes(bool hasLiked)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using LinkDotNet.Blog.Domain;
Expand Down

0 comments on commit 5e5c947

Please sign in to comment.