forked from GitHub-Mirror/riotX-android
Dagger: fix no session
This commit is contained in:
@ -105,7 +105,7 @@ class VectorFirebaseMessagingService : FirebaseMessagingService() {
|
||||
if (refreshedToken == null) {
|
||||
Timber.w("onNewToken:received null token")
|
||||
} else {
|
||||
if (PreferencesManager.areNotificationEnabledForDevice(applicationContext)) {
|
||||
if (PreferencesManager.areNotificationEnabledForDevice(applicationContext) && activeSessionHolder.hasActiveSession()) {
|
||||
pusherManager.registerPusherWithFcmKey(refreshedToken)
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class PushersManager @Inject constructor(
|
||||
}
|
||||
|
||||
fun unregisterPusher(pushKey: String, callback: MatrixCallback<Unit>) {
|
||||
val currentSession = activeSessionHolder.getActiveSession()
|
||||
val currentSession = activeSessionHolder.getSafeActiveSession() ?: return
|
||||
currentSession.removeHttpPusher(pushKey, stringProvider.getString(R.string.pusher_app_id), callback)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user