Make NotificationOverlay dependency optional in CollectionSettings

This commit is contained in:
Dean Herbert 2022-07-28 14:35:27 +09:00
parent 392cb352cc
commit ca68574473

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
private RealmAccess realm { get; set; } = null!; private RealmAccess realm { get; set; } = null!;
[Resolved] [Resolved]
private INotificationOverlay notificationOverlay { get; set; } = null!; private INotificationOverlay? notificationOverlay { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay) private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
@ -51,7 +51,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
private void deleteAllCollections() private void deleteAllCollections()
{ {
realm.Write(r => r.RemoveAll<BeatmapCollection>()); realm.Write(r => r.RemoveAll<BeatmapCollection>());
notificationOverlay.Post(new ProgressCompletionNotification { Text = "Deleted all collections!" }); notificationOverlay?.Post(new ProgressCompletionNotification { Text = "Deleted all collections!" });
} }
} }
} }