Skip to content

Commit

Permalink
feat(templates): add diagnostic button to AppErrorBoundary of Boilerp…
Browse files Browse the repository at this point in the history
…late #9177 (#9178)
  • Loading branch information
msynk authored Nov 10, 2024
1 parent cffda1a commit bf20078
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ else
<BitButton OnClick="Refresh">@localizer[nameof(AppStrings.Refresh)]</BitButton>
<BitButton OnClick="GoHome" Variant="BitVariant.Outline">@localizer[nameof(AppStrings.Home)]</BitButton>
<BitButton OnClick="Recover" Variant="BitVariant.Outline">@localizer[nameof(AppStrings.Recover)]</BitButton>
<BitButton OnClick="ShowDiagnostic" Variant="BitVariant.Text" IconOnly IconName="@BitIconName.Diagnostic" />
</BitStack>
</BitStack>
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ public partial class AppErrorBoundary
{
private bool showException;

[AutoInject] private PubSubService pubSubService = default!;
[AutoInject] private IExceptionHandler exceptionHandler = default!;
[AutoInject] private IStringLocalizer<AppStrings> localizer = default!;
[AutoInject] private NavigationManager navigationManager = default!;
[AutoInject] private IStringLocalizer<AppStrings> localizer = default!;

protected override void OnInitialized()
{
Expand All @@ -32,4 +33,9 @@ private void GoHome()
{
navigationManager.NavigateTo(Urls.HomePage, forceLoad: true);
}

private void ShowDiagnostic()
{
pubSubService.Publish(PubSubMessages.SHOW_DIAGNOSTIC_MODAL);
}
}

0 comments on commit bf20078

Please sign in to comment.