X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fnotification%2FNewSoneHandler.kt;h=89150cc4aac57f060850afa7d3287a294ff734b8;hb=2ffc429995f67d23ac3e36007044cf23ca1390de;hp=83be6fd945079277aa1076baaba93c0f2d84b1ad;hpb=b6a8b559407daefde5ce01967190cccf97e2bb00;p=Sone.git 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