Skip to content
Merged
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
13 changes: 11 additions & 2 deletions src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,13 @@ private string GetTextFromCursor()
return text[batchStart..batchEnd].Trim();
}


private void SetStatus(string text, bool autoClear = true)
{
_statusClearCts?.Cancel();
_statusClearCts?.Dispose();
_statusClearCts = null; // ← prevent stale reference to a disposed CTS

StatusText.Text = text;

if (autoClear && !string.IsNullOrEmpty(text))
Expand All @@ -331,12 +334,18 @@ private void SetStatus(string text, bool autoClear = true)
var token = _statusClearCts.Token;
_ = Task.Delay(3000, token).ContinueWith(_ =>
{
Avalonia.Threading.Dispatcher.UIThread.Post(() => StatusText.Text = "");
Avalonia.Threading.Dispatcher.UIThread.Post(() =>
{
StatusText.Text = "";
_statusClearCts = null; // ← also clear after natural expiry
});
}, TaskContinuationOptions.OnlyOnRanToCompletion);

}
}

private async void Connect_Click(object? sender, RoutedEventArgs e)

private async void Connect_Click(object? sender, RoutedEventArgs e)
{
await ShowConnectionDialogAsync();
}
Expand Down