diff --git a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs index 689112eb9dc..0f782f621dc 100644 --- a/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Pages/CacheList.razor.cs @@ -19,23 +19,24 @@ public partial class CacheList [Inject, NotNull] private IStringLocalizer? Localizer { get; set; } - private List _cacheList = []; + private List _cacheList = []; /// /// /// - protected override async Task OnParametersSetAsync() + protected override void OnInitialized() { - await base.OnParametersSetAsync(); - - await Task.Yield(); + base.OnInitialized(); UpdateCacheList(); } private void OnDelete(object key) { - CacheManager.Clear(key); - UpdateCacheList(); + if (key is ICacheEntry entry) + { + CacheManager.Clear(entry.Key); + UpdateCacheList(); + } } private void OnDeleteAll() @@ -51,15 +52,15 @@ private void OnRefresh() private void UpdateCacheList() { - _cacheList = CacheManager.Keys.OrderBy(i => i.ToString()).Select(key => + _cacheList = [.. CacheManager.Keys.OrderBy(i => i.ToString()).Select(key => { ICacheEntry? entry = null; if (CacheManager.TryGetCacheEntry(key, out var val)) { entry = val; } - return (object)entry!; - }).ToList(); + return entry; + }).Where(i => i != null)]; } private static string GetKey(object data) => data is ICacheEntry entry ? entry.Key.ToString()! : "-"; diff --git a/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor b/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor index a769e41561f..2c343e826b7 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Stacks.razor @@ -3,7 +3,7 @@

@Localizer["Title"]

- +
diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 293011dbea2..da989fc7f7a 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -6469,7 +6469,7 @@ "BootstrapBlazor.Server.Components.Samples.Stacks": { "Title": "Stack Layout", "BasicTitle": "Basic", - "BasicIntroe": "Lets you arrange its subcomponents in a horizontal or vertical stack", + "BasicIntro": "Lets you arrange its subcomponents in a horizontal or vertical stack", "RowMode": "Row", "ColumnMode": "Column", "Mode": "mode", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 9b622cd44c6..073ccc0977a 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -6469,7 +6469,7 @@ "BootstrapBlazor.Server.Components.Samples.Stacks": { "Title": "Stack 布局", "BasicTitle": "普通用法", - "BasicIntroe": "可用于在水平或垂直堆栈中排列其子组件", + "BasicIntro": "可用于在水平或垂直堆栈中排列其子组件", "RowMode": "行布局", "ColumnMode": "列布局", "Mode": "布局类型",