fix: delete files is on main thread

This commit is contained in:
Fangh 2024-02-01 22:48:03 +01:00
parent a64ce8c7ac
commit 3adfb8a363

View File

@ -73,7 +73,7 @@ private void RunDeleteTasks(List<Task> deleteTasks, Action callback_OnFinish)
int taskCount = deleteTasks.Count; int taskCount = deleteTasks.Count;
Debug.Log($"There are {taskCount} files to delete", this); Debug.Log($"There are {taskCount} files to delete", this);
Task.WhenAll(deleteTasks).ContinueWith(_ => Task.WhenAll(deleteTasks).ContinueWithOnMainThread(_ =>
{ {
Debug.Log($"all delete tasks are done", this); Debug.Log($"all delete tasks are done", this);
callback_OnFinish?.Invoke(); callback_OnFinish?.Invoke();