Skip to content
Merged
Changes from 2 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
21 changes: 14 additions & 7 deletions src/Core/Components/InputFile/FluentInputFile.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial class FluentInputFile : FluentComponentBase, IAsyncDisposable
private ElementReference? _containerElement;
private InputFile? _inputFile;
private IJSObjectReference? _containerInstance;

public static string ResourceLoadingBefore = "Loading...";
public static string ResourceLoadingCompleted = "Completed";
public static string ResourceLoadingCanceled = "Canceled";
Expand Down Expand Up @@ -427,15 +427,22 @@ private async Task UpdateProgressAsync(int percent, string title)
// Unregister the drop zone events
public async ValueTask DisposeAsync()
{
if (_containerInstance != null)
try
{
await _containerInstance.InvokeVoidAsync("dispose");
await _containerInstance.DisposeAsync();
}
if (_containerInstance != null)
{
await _containerInstance.InvokeVoidAsync("dispose");
await _containerInstance.DisposeAsync();
}

if (Module != null)
if (Module != null)
{
await Module.DisposeAsync();
}
}
catch (JSDisconnectedException)
{
await Module.DisposeAsync();
// Swallow. See: https://stackoverflow.com/questions/72488563/blazor-server-side-application-throwing-system-invalidoperationexception-javas
}
}
}
Loading