From 2a7147240f74af787b7f0d217c7c63e250d912e7 Mon Sep 17 00:00:00 2001
From: Dean Herbert <pe@ppy.sh>
Date: Wed, 27 Dec 2017 13:25:42 +0900
Subject: [PATCH] Fix progress notifications not creating their completion
 notification early enough

FIxes notification overlay thinking it has no notifications left and closing.
---
 osu.Game/Overlays/NotificationOverlay.cs                | 9 ++++++---
 osu.Game/Overlays/Notifications/ProgressNotification.cs | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs
index 2f1c3285ef..f19a80ef47 100644
--- a/osu.Game/Overlays/NotificationOverlay.cs
+++ b/osu.Game/Overlays/NotificationOverlay.cs
@@ -85,9 +85,12 @@ namespace osu.Game.Overlays
 
         private void notificationClosed()
         {
-            // hide ourselves if all notifications have been dismissed.
-            if (totalCount == 0)
-                State = Visibility.Hidden;
+            Schedule(() =>
+            {
+                // hide ourselves if all notifications have been dismissed.
+                if (totalCount == 0)
+                    State = Visibility.Hidden;
+            });
 
             updateCounts();
         }
diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs
index c39c630858..d797372390 100644
--- a/osu.Game/Overlays/Notifications/ProgressNotification.cs
+++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs
@@ -95,8 +95,8 @@ namespace osu.Game.Overlays.Notifications
 
         protected virtual void Completed()
         {
-            base.Close();
             CompletionTarget?.Invoke(CreateCompletionNotification());
+            base.Close();
         }
 
         public override bool DisplayOnTop => false;