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`.
This commit is contained in:
greenart7c3
2026-03-16 17:13:53 -03:00
parent e2985f47a6
commit bb0dcfa0bb
2 changed files with 4 additions and 0 deletions
@@ -23,6 +23,7 @@ package com.greenart7c3.nostrsigner.service
import android.content.Context import android.content.Context
import android.util.Log import android.util.Log
import com.greenart7c3.nostrsigner.Amber import com.greenart7c3.nostrsigner.Amber
import com.greenart7c3.nostrsigner.BuildFlavorChecker
import com.greenart7c3.nostrsigner.LocalPreferences import com.greenart7c3.nostrsigner.LocalPreferences
import com.greenart7c3.nostrsigner.models.Account import com.greenart7c3.nostrsigner.models.Account
import com.vitorpamplona.quartz.nip01Core.relay.client.NostrClient 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 * Call this method every time the relay list or the user list changes
*/ */
suspend fun updateFilter() { suspend fun updateFilter() {
if (BuildFlavorChecker.isOfflineFlavor()) return
LocalPreferences.allAccounts(appContext).forEach { LocalPreferences.allAccounts(appContext).forEach {
if (!subIds.containsKey(it.hexKey)) { if (!subIds.containsKey(it.hexKey)) {
subIds[it.hexKey] = UUID.randomUUID().toString() subIds[it.hexKey] = UUID.randomUUID().toString()
@@ -22,6 +22,7 @@ package com.greenart7c3.nostrsigner.service
import android.content.Context import android.content.Context
import com.greenart7c3.nostrsigner.Amber import com.greenart7c3.nostrsigner.Amber
import com.greenart7c3.nostrsigner.BuildFlavorChecker
import com.greenart7c3.nostrsigner.LocalPreferences import com.greenart7c3.nostrsigner.LocalPreferences
import com.greenart7c3.nostrsigner.models.Account import com.greenart7c3.nostrsigner.models.Account
import com.vitorpamplona.quartz.nip01Core.core.hexToByteArray 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 * Call this method every time the relay list or the user list changes
*/ */
suspend fun updateFilter() { suspend fun updateFilter() {
if (BuildFlavorChecker.isOfflineFlavor()) return
LocalPreferences.allAccounts(appContext).forEach { LocalPreferences.allAccounts(appContext).forEach {
if (!subIds.containsKey(it.hexKey)) { if (!subIds.containsKey(it.hexKey)) {
subIds[it.hexKey] = UUID.randomUUID().toString() subIds[it.hexKey] = UUID.randomUUID().toString()