Skip to content

Commit 29269b2

Browse files
committed
enhance: use await Dispatcher.UIThread.InvokeAsync instead of Dispatcher.UIThread.Invoke to make sure all code are running in order
Signed-off-by: leo <[email protected]>
1 parent 80ae34c commit 29269b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ViewModels/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,10 +1267,10 @@ public void RefreshTags()
12671267

12681268
public void RefreshCommits()
12691269
{
1270-
Dispatcher.UIThread.Invoke(() => _histories.IsLoading = true);
1271-
12721270
Task.Run(async () =>
12731271
{
1272+
await Dispatcher.UIThread.InvokeAsync(() => _histories.IsLoading = true);
1273+
12741274
var builder = new StringBuilder();
12751275
builder.Append($"-{Preferences.Instance.MaxHistoryCommits} ");
12761276

0 commit comments

Comments
 (0)