Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPressButton: ({ onPressButton }) => (event) => {
analytics.track('Clicked "Max" in Send flow input');
if (onPressButton) {
onPressButton(event);
}
},
}),
.then(success => {
if (success) {
toggleImporting(false);
analytics.track('Imported seed phrase', {
hadPreviousAddressWithValue: isEmpty,
});
navigate('WalletScreen');
} else {
toggleImporting(false);
}
})
.catch(error => {
onSelectLanguage: ({ settingsChangeLanguage }) => (language) => {
settingsChangeLanguage(language);
analytics.track('Changed language', { language });
},
}),
handleScanSuccess = async ({ data }) => {
const {
walletConnectOnSessionRequest,
navigation,
setSafeTimeout,
} = this.props;
if (!data) return null;
this.setState({ enableScanning: false });
Vibration.vibrate();
const address = await addressUtils.getEthereumAddressFromQRCodeData(data);
if (address) {
analytics.track('Scanned address QR code');
navigation.navigate('WalletScreen');
navigation.navigate('SendSheet', { address });
return setSafeTimeout(this.handleReenableScanning, 1000);
}
if (data.startsWith('wc:')) {
analytics.track('Scanned WalletConnect QR code');
await walletConnectOnSessionRequest(data);
return setSafeTimeout(this.handleReenableScanning, 2000);
}
analytics.track('Scanned broken or unsupported QR code', { qrCodeData: data });
return Alert({
callback: this.handleReenableScanning,
message: lang.t('wallet.unrecognized_qrcode'),
title: lang.t('wallet.unrecognized_qrcode_title'),
onChangeAssetAmount = assetAmount => {
if (isString(assetAmount)) {
this.props.sendUpdateAssetAmount(assetAmount);
analytics.track('Changed token input in Send flow');
}
};
.then(() => {
this.setState({ isAuthorizing: false });
analytics.track('Sent transaction', {
assetName: selected.name,
assetType: selected.isNft ? 'unique_token' : 'token',
isRecepientENS: toLower(recipient.slice(-4)) === '.eth',
});
sendClearFields();
navigation.navigate('ProfileScreen');
})
.catch(() => {
.then((keychainValue) => {
setSeedPhrase(keychainValue);
analytics.track('Viewed backup seed phrase text');
})
.catch(hideSeedPhrase);
export function commitGroupSuccess(projectId: string, groupId: string): CommitGroupSuccess {
analytics.track('Mapswipe Mobile - Completed Group', {
projectId,
groupId,
});
return { type: COMMIT_GROUP_SUCCESS, projectId, groupId };
}
onResetAssetSelection = () => {
analytics.track('Reset asset selection in Send flow');
this.sendUpdateSelected({});
};
export function commitGroupFailed(
projectId: string,
groupId: string,
error: {},
): CommitGroupFailed {
analytics.track('Mapswipe Mobile - Failed Group ', {
projectId,
groupId,
error,
});
return {
type: COMMIT_GROUP_FAILED,
projectId,
groupId,
error,
};
}