Skip to content

Commit bc9991c

Browse files
committed
Refactor agent loading to use Dispatcher for UI thread execution; bump version to 0.1.12.0
1 parent caaee14 commit bc9991c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<Version>0.1.11.0</Version>
4+
<Version>0.1.12.0</Version>
55
<AssemblyVersion>$(Version)</AssemblyVersion>
66
<FileVersion>$(Version)</FileVersion>
77
<InformationalVersion>$(Version)</InformationalVersion>

SemanticCode/ViewModels/AgentsManagementViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,17 @@ private void OnFileChanged(object sender, FileSystemEventArgs e)
305305
// 延迟加载以避免文件锁定问题
306306
Task.Delay(500).ContinueWith(_ =>
307307
{
308-
LoadAgents();
309-
}, TaskScheduler.FromCurrentSynchronizationContext());
308+
Dispatcher.UIThread.Post(LoadAgents);
309+
});
310310
}
311311

312312
private void OnFileRenamed(object sender, RenamedEventArgs e)
313313
{
314314
System.Diagnostics.Debug.WriteLine($"File renamed: {e.OldName} -> {e.Name}");
315315
Task.Delay(500).ContinueWith(_ =>
316316
{
317-
LoadAgents();
318-
}, TaskScheduler.FromCurrentSynchronizationContext());
317+
Dispatcher.UIThread.Post(LoadAgents);
318+
});
319319
}
320320

321321
private void OnAgentInstalled(object? sender, EventArgs e)

0 commit comments

Comments
 (0)