🎨 Use convenience method
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 1 Dec 2019 19:24:21 +0000 (20:24 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 11 Dec 2019 15:58:48 +0000 (16:58 +0100)
src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt

index 83be6fd..89150cc 100644 (file)
@@ -33,7 +33,7 @@ class NewSoneHandler(private val notificationManager: NotificationManager, templ
 
        @Subscribe
        fun newSoneFound(newSoneFoundEvent: NewSoneFoundEvent) {
-               if (!notificationManager.hasNotification("first-start-notification")) {
+               if (!notificationManager.hasFirstStartNotification()) {
                        notification.add(newSoneFoundEvent.sone)
                        notificationManager.addNotification(notification)
                }
@@ -50,6 +50,3 @@ class NewSoneHandler(private val notificationManager: NotificationManager, templ
        }
 
 }
-
-private fun NotificationManager.hasNotification(id: String) =
-               getNotification(id) != null