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