1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 11:02:54 +08:00

Refresh view after import completes

This commit is contained in:
Dean Herbert 2020-12-15 12:57:28 +09:00
parent db4f2d5ffb
commit 0d4ac2f748

View File

@ -154,17 +154,17 @@ namespace osu.Game.Screens.Import
if (string.IsNullOrEmpty(path)) if (string.IsNullOrEmpty(path))
return; return;
Task.Factory.StartNew(async () => await game.Import(path), TaskCreationOptions.LongRunning) Task.Factory.StartNew(async () =>
.ContinueWith(_ =>
{ {
// some files will be deleted after successful import, so we want to refresh the view. await game.Import(path);
// some files will be deleted after successful import, so we want to refresh the view.
Schedule(() => Schedule(() =>
{ {
// should probably be exposed as a refresh method. // should probably be exposed as a refresh method.
fileSelector.CurrentPath.TriggerChange(); fileSelector.CurrentPath.TriggerChange();
}); });
}); }, TaskCreationOptions.LongRunning);
} }
} }
} }