Skip to content

Commit

Permalink
Dont register to the push server when using direct connection
Browse files Browse the repository at this point in the history
  • Loading branch information
greenart7c3 committed Aug 30, 2024
1 parent 4e6a189 commit 53424a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object PushNotificationUtils {

@OptIn(DelicateCoroutinesApi::class)
suspend fun init(accounts: List<AccountInfo>) {
if (hasInit) {
if (hasInit || NostrSigner.getInstance().settings.notificationType == NotificationType.DIRECT) {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ package com.greenart7c3.nostrsigner.service
import android.util.Log
import com.google.firebase.messaging.FirebaseMessaging
import com.greenart7c3.nostrsigner.AccountInfo
import com.greenart7c3.nostrsigner.NostrSigner
import com.greenart7c3.nostrsigner.ui.AccountStateViewModel
import com.greenart7c3.nostrsigner.ui.NotificationType
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.tasks.await
Expand All @@ -34,7 +36,7 @@ object PushNotificationUtils {

suspend fun init(accounts: List<AccountInfo>) =
with(Dispatchers.IO) {
if (hasInit) {
if (hasInit || NostrSigner.getInstance().settings.notificationType == NotificationType.DIRECT) {
return@with
}
// get user notification token provided by firebase
Expand Down

0 comments on commit 53424a8

Please sign in to comment.