Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const SafeAction = (screen, obj, max = 0) => {
if (Actions.state.routes.filter(r => r.routeName === screen).length > max) {
console.log(`${screen} rejected`);
} else {
Actions.push(screen, obj);
console.log(`${screen} pushed`);
}
};
export default function* deeplinkSaga() {
const linking = yield call(initLinkingWatcher)
while (true) {
const action = yield take(linking)
, url = action.payload
yield put(action)
if (url.startsWith('share?'))
Actions.push('offerBasket', {picture: {uri: url.split(/share\?/)[1]}})
if (url.startsWith('essenskoerbe'))
Actions.push('basket', {id: parseInt(url.split(/essenskoerbe\//)[1])})
}
}
onPress: () => Actions.push("scene5")
})}
moveToMainAppScreen = () => {
Actions.push('testMainAppScreen');
};
onPress={() => Actions.push('locationSelector', {
callback: ({latitude, longitude}) => this.setState({latitude, longitude}),
location: {latitude, longitude}
})}
testID="basketEdit.map"
sendEther = () => {
Actions.push(ETHER_AMOUNT_SCENE, { wallet: this.props.payload });
}
onPress={() => Actions.push('offerBasket')}
/>
onPress={() => Actions.push('basket', {id: item.id})}
style={styles.item}
navigateToNextScene = () => {
Keyboard.dismiss();
const slot = {
walletName: this.state.walletName,
}
Actions.push(CREATE_WALLET_DISPLAY_PASSPHRASE, { slot })
}
render() {
navigateToNextScene = () => {
Keyboard.dismiss();
const slot = {
amount: this.state.amount,
}
Actions.push(SCAN_QR_SCENE, { slot });
}