From a7811f312c1add5f6a16e44970ebd010173abed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Mon, 15 Feb 2021 18:19:30 +0800 Subject: [PATCH] fix an issue --- Flow.Launcher/ViewModel/MainViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 0cf4b11dc..3e71adcd1 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -98,15 +98,15 @@ namespace Flow.Launcher.ViewModel // it is not supposed to be false because it won't be complete while (await queueReader.WaitToReadAsync()) { - queue.Clear(); await Task.Delay(20); - await foreach (var item in queueReader.ReadAllAsync()) + while (queueReader.TryRead(out var item)) { if (!item.Token.IsCancellationRequested) queue[item.ID] = item; } UpdateResultView(queue.Values); + queue.Clear(); } Log.Error("MainViewModel", "Unexpected ResultViewUpdate ends");