mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 10:58:23 +00:00
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:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user