-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathGiscus.razor
More file actions
16 lines (15 loc) · 600 Bytes
/
Copy pathGiscus.razor
File metadata and controls
16 lines (15 loc) · 600 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@inject IJSRuntime JsRuntime
@inject IOptions<ApplicationConfiguration> AppConfiguration
@inject IOptions<GiscusConfiguration> GiscusConfiguration
<div class="giscus">
</div>
@code {
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender && AppConfiguration.Value.IsGiscusEnabled)
{
await using var _ = await JsRuntime.InvokeAsync<IJSObjectReference>("import", "./Features/ShowBlogPost/Components/Giscus.razor.js");
await JsRuntime.InvokeVoidAsync("initGiscus", "giscus", GiscusConfiguration.Value);
}
}
}