mirror of https://github.com/ppy/osu
Refresh view after import succeeds
This commit is contained in:
parent
cafe81ab97
commit
db4f2d5ffb
|
@ -154,16 +154,17 @@ private void startImport(string path)
|
|||
if (string.IsNullOrEmpty(path))
|
||||
return;
|
||||
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
currentFileText.Text = "No such file";
|
||||
currentFileText.FlashColour(colours.Red, duration);
|
||||
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.
|
||||
|
||||
string[] paths = { path };
|
||||
|
||||
Task.Factory.StartNew(() => game.Import(paths), TaskCreationOptions.LongRunning);
|
||||
Schedule(() =>
|
||||
{
|
||||
// should probably be exposed as a refresh method.
|
||||
fileSelector.CurrentPath.TriggerChange();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue