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
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ public class CollectionsSettings : SettingsSubsection
private RealmAccess realm { get; set; } = null!;
[Resolved]
private INotificationOverlay notificationOverlay { get; set; } = null!;
private INotificationOverlay? notificationOverlay { get; set; }
[BackgroundDependencyLoader]
private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dialogOverlay)
@ -51,7 +51,7 @@ private void load(LegacyImportManager? legacyImportManager, IDialogOverlay? dial
private void deleteAllCollections()
{
realm.Write(r => r.RemoveAll<BeatmapCollection>());
notificationOverlay.Post(new ProgressCompletionNotification { Text = "Deleted all collections!" });
notificationOverlay?.Post(new ProgressCompletionNotification { Text = "Deleted all collections!" });
}
}
}