Skip to content

Commit

Permalink
fix: disable push notification if wallet service url is empty (#473)
Browse files Browse the repository at this point in the history
chore: add dependency
  • Loading branch information
alexruzenhack committed May 15, 2024
1 parent 91d000a commit b72f1dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Linking, Platform, Text } from 'react-native';
import { getStatusBarHeight } from 'react-native-status-bar-height';
import { isEmpty } from 'lodash';
import baseStyle from './styles/init';
import { KEYCHAIN_USER } from './constants';
import { KEYCHAIN_USER, NETWORK_MAINNET } from './constants';
import { STORE } from './store';
import { TxHistory } from './models';
import { COLORS, STYLE } from './styles/themes';
Expand Down Expand Up @@ -387,6 +387,11 @@ export const isPushNotificationAvailableForUser = (state) => (
state.pushNotification.available
// On iOS a simulator can't register a device token on APNS
&& state.pushNotification.deviceRegistered
// TODO: We should drop this condition when we add support other networks
// XXX: We don't have support in this app to generate device tokens
// to the FCM testnet app. Currently we embbed only the mainnet
// configuration file during the build.
&& state.networkSettings.network === NETWORK_MAINNET
// If Wallet Service URLs are empty it makes impossible to use the
// Wallet Service API to register the device's token.
&& !isEmpty(state.networkSettings.walletServiceUrl)
Expand Down

0 comments on commit b72f1dd

Please sign in to comment.