fix(central-ui): resolve CentralUI-020..025 — auth-ping idle logout, DebugView race, push-handler disposal guard, JS-interop catch narrowing, claim-constant helper, SessionExpiry tests
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
@inject CommunicationService CommunicationService
|
||||
@inject IJSRuntime JS
|
||||
@inject IDialogService Dialog
|
||||
@inject ILogger<ParkedMessages> Logger
|
||||
|
||||
<div class="container-fluid mt-3">
|
||||
<ToastNotification @ref="_toast" />
|
||||
@@ -694,7 +695,18 @@
|
||||
await JS.InvokeVoidAsync("navigator.clipboard.writeText", text);
|
||||
_toast.ShowSuccess("Copied to clipboard.");
|
||||
}
|
||||
catch { _toast.ShowError("Copy failed."); }
|
||||
catch (JSDisconnectedException)
|
||||
{
|
||||
// Circuit gone — the page is being torn down; nothing to surface.
|
||||
// CentralUI-023: distinguished from a genuine interop failure.
|
||||
}
|
||||
catch (JSException ex)
|
||||
{
|
||||
// A real clipboard failure (e.g. permission denied) — surface it to
|
||||
// the user and log it so it is not invisible in production.
|
||||
Logger.LogWarning(ex, "Clipboard copy failed.");
|
||||
_toast.ShowError("Copy failed.");
|
||||
}
|
||||
}
|
||||
|
||||
// ── Helpers ──
|
||||
|
||||
Reference in New Issue
Block a user