1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:20:04 +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))
return;
Task.Factory.StartNew(async () => await game.Import(path), TaskCreationOptions.LongRunning)
.ContinueWith(_ =>
{
// some files will be deleted after successful import, so we want to refresh the view.
Task.Factory.StartNew(async () =>
{
await game.Import(path);
Schedule(() =>
{
// should probably be exposed as a refresh method.
fileSelector.CurrentPath.TriggerChange();
});
// some files will be deleted after successful import, so we want to refresh the view.
Schedule(() =>
{
// should probably be exposed as a refresh method.
fileSelector.CurrentPath.TriggerChange();
});
}, TaskCreationOptions.LongRunning);
}
}
}