Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
navigate() {
const { menu } = this.state;
if (menu) {
// Pop to menu
Actions.popTo('Menu');
} else if (Actions.currentScene !== 'Menu') {
// Add guard so that it wont push twice]
Actions.Menu();
}
}
}
_renderLeft() {
if (Actions.currentScene === 'customNavBar1') {
return (
console.log('Hamburger button pressed')} style={[styles.navBarItem, { paddingLeft: 10 }]}>
<img style="{{">
);
}
return (
<img style="{{">
);
}
launchModal(modal).then(response => {
if (response) {
plugin.sourceFile = { uri: response }
}
const key = Actions.currentScene === SPEND ? PLUGIN_SPEND : PLUGIN_BUY
console.log('pvs: key', key)
Actions[key]({ plugin: plugin })
})
return
export const exchangeTimerExpired = (swapInfo: GuiSwapInfo) => async (dispatch: Dispatch, getState: GetState) => {
if (Actions.currentScene !== Constants.EXCHANGE_QUOTE_SCENE) return
Actions[Constants.EXCHANGE_QUOTE_PROCESSING_SCENE]()
try {
swapInfo = await fetchSwapQuote(getState(), swapInfo.request)
Actions[Constants.EXCHANGE_QUOTE_SCENE]({ swapInfo })
dispatch({ type: 'UPDATE_SWAP_QUOTE', data: swapInfo })
} catch (error) {
Actions.popTo(Constants.EXCHANGE_SCENE)
dispatch(processSwapQuoteError(error))
}
}
BackHandler.addEventListener('hardwareBackPress', () => {
try {
if (Actions.currentScene == 'home') {
BackHandler.exitApp();
}
return false;
} catch (err) {
return false;
}
});
}
export const mapStateToProps = (state: State) => {
const expiration = Actions.currentScene === Constants.EXCHANGE_SCENE ? state.cryptoExchange.quoteExpireDate : null
return {
expiration
}
}
export const mapDispatchToProps = (dispatch: Dispatch) => ({
isCurrentScene = (sceneKey: string) => {
return Actions.currentScene === sceneKey
}
isCurrentScene = (sceneKey: string) => {
return Actions.currentScene === sceneKey
}
toChat(dialog) {
if (Actions.currentScene !== 'chat') {
Actions.replace('chat', {
dialog: dialog,
title: dialog.name,
});
this.props.clearSelectedUser();
this.props.clearSearchUsersList();
}
}
export const openDrawer = () => (dispatch: Dispatch, getState: GetState) => {
const state = getState()
const selectedWallet = getSelectedWalletId(state)
if (selectedWallet.length > 0 && Actions.currentScene !== 'DrawerOpen') {
Actions.drawerOpen()
}
}