Skip to content
Closed
Changes from 1 commit
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: 13 additions & 0 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@
_ = RegisterClockAndDateUpdateAsync();
}

private int cancelIndex = 0;

private void RegisterViewUpdate()
{
var resultUpdateChannel = Channel.CreateUnbounded<ResultsForUpdate>();
Expand All @@ -212,6 +214,17 @@
await Task.Delay(20);
while (channelReader.TryRead(out var item))
{
if (item.shouldClearExistingResults)
{
cancelIndex++;
if (cancelIndex > 1)
{
// Assume one task for clearing existing results is cancelled
continue;
}
}


if (!item.Token.IsCancellationRequested)
queue[item.ID] = item;
}
Expand Down Expand Up @@ -1842,7 +1855,7 @@
VisibilityChanged?.Invoke(this, new VisibilityChangedEventArgs { IsVisible = false });
}

#pragma warning restore VSTHRD100 // Avoid async void methods

Check warning on line 1858 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`VSTHRD` is not a recognized word. (unrecognized-spelling)

/// <summary>
/// Save history, user selected records and top most records
Expand Down
Loading