Skip to content

Commit

Permalink
fix(blazorui): resolve issues of disposing BitDataGrid and BitFileUpl…
Browse files Browse the repository at this point in the history
…oad #8986 (#8987)
  • Loading branch information
msynk authored Oct 23, 2024
1 parent f411c4b commit 565b70f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@ public async ValueTask DisposeAsync()
// The JS side may routinely be gone already if the reason we're disposing is that
// the client disconnected. This is not an error.
}
catch(JSException ex)
{
// it seems it's safe to just ignore this exception here.
// otherwise it will blow up the MAUI app in a page refresh for example.
Console.WriteLine(ex.Message);
}
}

private void CloseColumnOptions()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@ protected virtual async ValueTask DisposeAsync(bool disposing)
await _dropZoneRef.DisposeAsync();
}
catch (JSDisconnectedException) { } // we can ignore this exception here
catch (JSException ex)
{
// it seems it's safe to just ignore this exception here.
// otherwise it will blow up the MAUI app in a page refresh for example.
Console.WriteLine(ex.Message);
}
}

if (_dotnetObj is not null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Bit.BlazorUI.Demo.Client.Maui.Platforms.Android;

[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true,
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTask,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
Expand Down

0 comments on commit 565b70f

Please sign in to comment.