X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNewSoneHandler.kt;h=89150cc4aac57f060850afa7d3287a294ff734b8;hp=83be6fd945079277aa1076baaba93c0f2d84b1ad;hb=2ffc429995f67d23ac3e36007044cf23ca1390de;hpb=3b926c638ec74eaf41e54463de6e85629f4e1be8 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt b/src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt index 83be6fd..89150cc 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt @@ -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