Docs: Fix mangled AppbarButtons.razor.cs merge#11419
Docs: Fix mangled AppbarButtons.razor.cs merge#11419danielchalmers merged 1 commit intoMudBlazor:devfrom
AppbarButtons.razor.cs merge#11419Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a mangled merge in AppbarButtons.razor.cs by reworking the component’s initialization logic. Key changes include replacing OnInitializedAsync with OnAfterRenderAsync for notification loading, removing the LayoutService event subscription, and initializing the _messages dictionary to null instead of an empty dictionary.
Comments suppressed due to low confidence (1)
src/MudBlazor.Docs/Shared/AppbarButtons.razor.cs:59
- The change to using OnAfterRenderAsync removed the subscription to LayoutService.MajorUpdateOccurred. Please confirm that this removal is intentional and that layout updates no longer need to trigger a UI state update.
protected override async Task OnInitializedAsync()
| public partial class AppbarButtons | ||
| { | ||
| private IDictionary<NotificationMessage, bool> _messages = new Dictionary<NotificationMessage, bool>(); | ||
| private IDictionary<NotificationMessage, bool> _messages = null; |
There was a problem hiding this comment.
Setting _messages to null may lead to a NullReferenceException if it is accessed before notifications are loaded. Consider initializing it to an empty dictionary or adding null checks where applicable.
| private IDictionary<NotificationMessage, bool> _messages = null; | |
| private IDictionary<NotificationMessage, bool> _messages = new Dictionary<NotificationMessage, bool>(); |
There was a problem hiding this comment.
Leaving it as it originally was
|
versile2
left a comment
There was a problem hiding this comment.
Returned to original, verified works and fixes problem with Docs.Server
AppbarButtons.razor.cs mergeAppbarButtons.razor.cs merge



Description
Broken in #11382
How Has This Been Tested?
Type of Changes
Checklist
dev).