diff --git a/src/NexusReader.UI.Shared/Components/MarkdownEditor.razor b/src/NexusReader.UI.Shared/Components/MarkdownEditor.razor index 550de4b..5d12ed5 100644 --- a/src/NexusReader.UI.Shared/Components/MarkdownEditor.razor +++ b/src/NexusReader.UI.Shared/Components/MarkdownEditor.razor @@ -116,10 +116,18 @@ await _module.DisposeAsync(); } } + catch (JSDisconnectedException) + { + // Fail silently during circuit disconnection + } + catch (ObjectDisposedException) + { + // Fail silently if JS runtime/module is already disposed + } catch (Exception ex) { - // Fail silently during page navigation/webview closures to avoid noisy logs - Console.WriteLine($"[MarkdownEditor] Error during JS cleanup: {ex.Message}"); + // Log other unexpected errors + Console.WriteLine($"[MarkdownEditor] Unexpected error during JS cleanup: {ex.Message}"); } finally {