Skip to content

Commit

Permalink
OperatingSystem.IsBrowser() simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr committed Jan 11, 2024
1 parent 61002c5 commit a58f848
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static class MessengerServiceCollectionExtensions
/// </summary>
public static IServiceCollection AddHxMessenger(this IServiceCollection services)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")))
if (OperatingSystem.IsBrowser())
{
// Allows gRPC Interceptors and HttpMessageHandlers to pass error messages to the HxMessenger without having to struggle with different DI Scope
return services.AddSingleton<IHxMessengerService, HxMessengerService>();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ namespace Havit.Blazor.GoogleTagManager;
public static class GoogleTagManagerServiceCollectionExtensions
{
/// <summary>
/// Adds Google Tag Mananger (GTM) support. Use <see cref="IHxGoogleTagManager"/> to push data to <c>dataLayer</c> and/or <see cref="HxGoogleTagManagerPageViewTracker"/> to track page-views.
/// Adds Google Tag Manager (GTM) support. Use <see cref="IHxGoogleTagManager"/> to push data to <c>dataLayer</c> and/or <see cref="HxGoogleTagManagerPageViewTracker"/> to track page-views.
/// </summary>
/// <param name="services"></param>
/// <param name="configureOptions"></param>
/// <returns></returns>
public static IServiceCollection AddHxGoogleTagManager(this IServiceCollection services, Action<HxGoogleTagManagerOptions> configureOptions)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("browser")))
if (OperatingSystem.IsBrowser())
{
services.AddSingleton<IHxGoogleTagManager, HxGoogleTagManager>();
}
Expand Down

0 comments on commit a58f848

Please sign in to comment.