Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Core/Components/DataGrid/FluentDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public partial class FluentDataGrid<TGridItem> : FluentComponentBase, IHandleEve

// Returns Loading if set (controlled). If not controlled,
// we assume the grid is loading until the next data load completes
internal bool EffectiveLoadingValue => Loading ?? ItemsProvider is not null;
internal bool EffectiveLoadingValue => Loading ?? (ItemsProvider is not null);

private ElementReference? _gridReference;
//private DotNetObjectReference<Type>? _dotNetObjectReference;
Expand Down
23 changes: 17 additions & 6 deletions src/Core/Components/MessageBar/Services/MessageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
MessageLock.EnterReadLock();
try
{
return MessageList;
return MessageList.ToList();
}
finally
{
Expand All @@ -66,11 +66,19 @@
MessageLock.EnterReadLock();
try
{
var messages = string.IsNullOrEmpty(section)
? MessageList
: MessageList.Where(x => x.Section == section);
IEnumerable<Message> messages = MessageList;

return count > 0 ? messages.Take(count) : messages;
if (!string.IsNullOrEmpty(section))
{
messages = messages.Where(x => x.Section == section);
}

if (count > 0)
{
messages = messages.Take(count);
}

return messages.ToList();
}
finally
{
Expand Down Expand Up @@ -263,7 +271,10 @@
MessageLock.ExitWriteLock();
}

await OnMessageItemsUpdatedAsync!.Invoke();
if (OnMessageItemsUpdatedAsync is { } handler)
{
await handler.Invoke();
}

return message;
}
Expand Down Expand Up @@ -326,7 +337,7 @@
/// <summary />
public void Dispose()
{
if (_navigationManager != null)

Check warning on line 340 in src/Core/Components/MessageBar/Services/MessageService.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Null check can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031)

Check warning on line 340 in src/Core/Components/MessageBar/Services/MessageService.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

Null check can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031)

Check warning on line 340 in src/Core/Components/MessageBar/Services/MessageService.cs

View workflow job for this annotation

GitHub Actions / Build and Test Core Lib

Null check can be simplified (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031)
{
_navigationManager.LocationChanged -= NavigationManager_LocationChanged;
}
Expand Down
Loading