Browse Source

Notify Blazor components when application configuration cache is reset

pull/25890/head
maliming 2 months ago
parent
commit
bbd9ce568e
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 8
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Configuration/BlazorServerCurrentApplicationConfigurationCacheResetService.cs

8
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/Configuration/BlazorServerCurrentApplicationConfigurationCacheResetService.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.Web.Configuration; using Volo.Abp.AspNetCore.Components.Web.Configuration;
using Volo.Abp.AspNetCore.Components.Web.Security;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Local; using Volo.Abp.EventBus.Local;
@ -13,15 +14,20 @@ public class BlazorServerCurrentApplicationConfigurationCacheResetService :
ITransientDependency ITransientDependency
{ {
private readonly ILocalEventBus _localEventBus; private readonly ILocalEventBus _localEventBus;
private readonly ApplicationConfigurationChangedService _applicationConfigurationChangedService;
public BlazorServerCurrentApplicationConfigurationCacheResetService( public BlazorServerCurrentApplicationConfigurationCacheResetService(
ILocalEventBus localEventBus) ILocalEventBus localEventBus,
ApplicationConfigurationChangedService applicationConfigurationChangedService)
{ {
_localEventBus = localEventBus; _localEventBus = localEventBus;
_applicationConfigurationChangedService = applicationConfigurationChangedService;
} }
public async Task ResetAsync(Guid? userId = null) public async Task ResetAsync(Guid? userId = null)
{ {
await _localEventBus.PublishAsync(new CurrentApplicationConfigurationCacheResetEventData(userId)); await _localEventBus.PublishAsync(new CurrentApplicationConfigurationCacheResetEventData(userId));
_applicationConfigurationChangedService.NotifyChanged();
} }
} }

Loading…
Cancel
Save