mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Refresh view after import succeeds
This commit is contained in:
parent
cafe81ab97
commit
db4f2d5ffb
@ -154,16 +154,17 @@ namespace osu.Game.Screens.Import
|
|||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!File.Exists(path))
|
Task.Factory.StartNew(async () => await game.Import(path), TaskCreationOptions.LongRunning)
|
||||||
|
.ContinueWith(_ =>
|
||||||
{
|
{
|
||||||
currentFileText.Text = "No such file";
|
// some files will be deleted after successful import, so we want to refresh the view.
|
||||||
currentFileText.FlashColour(colours.Red, duration);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string[] paths = { path };
|
Schedule(() =>
|
||||||
|
{
|
||||||
Task.Factory.StartNew(() => game.Import(paths), TaskCreationOptions.LongRunning);
|
// should probably be exposed as a refresh method.
|
||||||
|
fileSelector.CurrentPath.TriggerChange();
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user