From 2653bd2f997c305d1497d74da66e33be9630cc84 Mon Sep 17 00:00:00 2001 From: cdwcgt Date: Sat, 19 Nov 2022 12:57:56 +0900 Subject: [PATCH] Make notification cannot cancel when Saving Zip Archive This operation cannot be stopped(if not dispose stream). so make it cannot cancel --- osu.Game/Database/LegacyModelExporter.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Database/LegacyModelExporter.cs b/osu.Game/Database/LegacyModelExporter.cs index d734d3341c..9fa6f64ee4 100644 --- a/osu.Game/Database/LegacyModelExporter.cs +++ b/osu.Game/Database/LegacyModelExporter.cs @@ -56,6 +56,9 @@ namespace osu.Game.Database /// public virtual async Task ExportASync(IHasGuidPrimaryKey uuid) { + bool canCancel = true; + Notification.CancelRequested += () => canCancel; + Guid id = uuid.ID; await Task.Run(() => { @@ -91,6 +94,7 @@ namespace osu.Game.Database } Notification.Text = "Saving Zip Archive..."; + canCancel = false; archive.SaveTo(OutputStream); } });