From 2ffc429995f67d23ac3e36007044cf23ca1390de Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 1 Dec 2019 20:24:21 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=8E=A8=20Use=20convenience=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../kotlin/net/pterodactylus/sone/web/notification/NewSoneHandler.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 -- 2.7.4