From bb0dcfa0bb661a9278c5cb2e014f61fb41b1fff4 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Mon, 16 Mar 2026 17:13:53 -0300 Subject: [PATCH] Disable notification and profile subscriptions for offline build flavor Prevent the app from attempting to update relay filters when running in the offline build flavor by adding a check to `BuildFlavorChecker.isOfflineFlavor()` in both `NotificationSubscription.kt` and `ProfileSubscription.kt`. --- .../greenart7c3/nostrsigner/service/NotificationSubscription.kt | 2 ++ .../com/greenart7c3/nostrsigner/service/ProfileSubscription.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/service/NotificationSubscription.kt b/app/src/main/java/com/greenart7c3/nostrsigner/service/NotificationSubscription.kt index 0c77428d..f59a1482 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/service/NotificationSubscription.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/service/NotificationSubscription.kt @@ -23,6 +23,7 @@ package com.greenart7c3.nostrsigner.service import android.content.Context import android.util.Log import com.greenart7c3.nostrsigner.Amber +import com.greenart7c3.nostrsigner.BuildFlavorChecker import com.greenart7c3.nostrsigner.LocalPreferences import com.greenart7c3.nostrsigner.models.Account import com.vitorpamplona.quartz.nip01Core.relay.client.NostrClient @@ -67,6 +68,7 @@ class NotificationSubscription( * Call this method every time the relay list or the user list changes */ suspend fun updateFilter() { + if (BuildFlavorChecker.isOfflineFlavor()) return LocalPreferences.allAccounts(appContext).forEach { if (!subIds.containsKey(it.hexKey)) { subIds[it.hexKey] = UUID.randomUUID().toString() diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/service/ProfileSubscription.kt b/app/src/main/java/com/greenart7c3/nostrsigner/service/ProfileSubscription.kt index f8e90929..fd39c858 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/service/ProfileSubscription.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/service/ProfileSubscription.kt @@ -22,6 +22,7 @@ package com.greenart7c3.nostrsigner.service import android.content.Context import com.greenart7c3.nostrsigner.Amber +import com.greenart7c3.nostrsigner.BuildFlavorChecker import com.greenart7c3.nostrsigner.LocalPreferences import com.greenart7c3.nostrsigner.models.Account import com.vitorpamplona.quartz.nip01Core.core.hexToByteArray @@ -114,6 +115,7 @@ class ProfileSubscription( * Call this method every time the relay list or the user list changes */ suspend fun updateFilter() { + if (BuildFlavorChecker.isOfflineFlavor()) return LocalPreferences.allAccounts(appContext).forEach { if (!subIds.containsKey(it.hexKey)) { subIds[it.hexKey] = UUID.randomUUID().toString()