From: David ‘Bombe’ Roden Date: Sun, 1 Dec 2019 19:24:21 +0000 (+0100) Subject: 🎨 Use convenience method X-Git-Tag: v81^2~5^2~92 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=2ffc429995f67d23ac3e36007044cf23ca1390de 🎨 Use convenience method --- 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