mirror of https://github.com/ppy/osu
delete notify post when duplicate export
This commit is contained in:
parent
d20e1df603
commit
ba345e5591
|
@ -60,7 +60,7 @@ protected LegacyModelExporter(Storage storage, RealmAccess realm)
|
||||||
/// If specified CancellationToken, then use it. Otherwise use PostNotification's CancellationToken.
|
/// If specified CancellationToken, then use it. Otherwise use PostNotification's CancellationToken.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task ExportAsync(TModel model, CancellationToken? cancellationToken = null)
|
public async Task<bool> ExportAsync(TModel model, CancellationToken? cancellationToken = null)
|
||||||
{
|
{
|
||||||
// check if the model is being exporting already
|
// check if the model is being exporting already
|
||||||
if (!exportingModels.Contains(model))
|
if (!exportingModels.Contains(model))
|
||||||
|
@ -69,10 +69,7 @@ public async Task ExportAsync(TModel model, CancellationToken? cancellationToken
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PostNotification?.Invoke(new SimpleErrorNotification
|
// model is being exported
|
||||||
{
|
|
||||||
Text = "File is being exported"
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +111,8 @@ public async Task ExportAsync(TModel model, CancellationToken? cancellationToken
|
||||||
|
|
||||||
exportingModels.Remove(model);
|
exportingModels.Remove(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue