mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2026-10-22 23:12:12 +03:00
Fix UI freezing due to attachment download statistics being updated on the wrong thread
This commit is contained in:
1 file changed
+4
-2
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Threading;
|
||||
using Avalonia.Threading;
|
||||
using DHT.Desktop.Common;
|
||||
using DHT.Desktop.Main.Controls;
|
||||
using DHT.Server.Data;
|
||||
@@ -134,9 +136,9 @@ sealed class AttachmentsPageModel : BaseModel, IDisposable {
|
||||
}
|
||||
|
||||
private void DownloadThreadOnOnItemFinished(object? sender, DownloadItem e) {
|
||||
++doneItemsCount;
|
||||
Interlocked.Increment(ref doneItemsCount);
|
||||
|
||||
UpdateDownloadMessage();
|
||||
Dispatcher.UIThread.Invoke(UpdateDownloadMessage);
|
||||
downloadStatisticsComputer.Recompute();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user