set the visible default to true.

This commit is contained in:
Ben
2024-02-24 22:02:07 +08:00
parent 4ac0483ec6
commit fc0b326443
2 changed files with 10 additions and 3 deletions

View File

@ -31,7 +31,7 @@
public MessageType Type { get; set; } public MessageType Type { get; set; }
[Parameter] [Parameter]
public bool Visible{ get; set; } public bool Visible { get; set; } = true;
public void RefreshMessage(string message, MessageType type, bool visible) public void RefreshMessage(string message, MessageType type, bool visible)
{ {

View File

@ -134,9 +134,16 @@
var messageTopVisible = !string.IsNullOrEmpty(_messageContent) && _messagePosition == "top"; var messageTopVisible = !string.IsNullOrEmpty(_messageContent) && _messagePosition == "top";
var messageBottomVisible = !string.IsNullOrEmpty(_messageContent) && _messagePosition == "bottom"; var messageBottomVisible = !string.IsNullOrEmpty(_messageContent) && _messagePosition == "bottom";
if (moduleMessageTop != null)
{
moduleMessageTop.RefreshMessage(_messageContent, _messageType, messageTopVisible); moduleMessageTop.RefreshMessage(_messageContent, _messageType, messageTopVisible);
}
if (moduleMessageBottom != null)
{
moduleMessageBottom.RefreshMessage(_messageContent, _messageType, messageBottomVisible); moduleMessageBottom.RefreshMessage(_messageContent, _messageType, messageBottomVisible);
} }
}
protected override async Task OnErrorAsync(Exception exception) protected override async Task OnErrorAsync(Exception exception)
{ {