2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Use new AuotPushFeature.getSubscription API

This commit is contained in:
Jonathan Almeida 2020-05-29 19:32:36 -04:00 committed by Jonathan Almeida
parent f640224859
commit ce15763cc4

View File

@ -59,15 +59,9 @@ internal class WebPushEngineDelegate(
override fun onGetSubscription(scope: String, onSubscription: (WebPushSubscription?) -> Unit) {
// We don't have the appServerKey unless an app is creating a new subscription so we
// allow the key to be null since it won't be overridden from a previous subscription.
pushFeature.subscribe(
scope = scope,
onSubscribeError = {
logger.error("Error on push onGetSubscription.")
onSubscription(null)
},
onSubscribe = { subscription ->
onSubscription(subscription.toEnginePushSubscription())
})
pushFeature.getSubscription(scope) {
onSubscription(it?.toEnginePushSubscription())
}
}
override fun onSubscribe(