ADD: security alert

This commit is contained in:
Overtorment 2018-10-25 00:32:36 +01:00
parent d0f138bc4f
commit 99f5ec3580
2 changed files with 26 additions and 0 deletions

View file

@ -24,6 +24,8 @@ async function startAndDecrypt(retry) {
console.log('loaded from disk');
EV(EV.enum.WALLETS_COUNT_CHANGED);
EV(EV.enum.TRANSACTIONS_COUNT_CHANGED);
let securityAlert = require('./security-alert');
await securityAlert.start();
// now, lets try to fetch balance and txs for first wallet if it is time for it
let hadToRefresh = false;
let noErr = true;

24
security-alert.js Normal file
View file

@ -0,0 +1,24 @@
import { AsyncStorage, Alert } from 'react-native';
async function start() {
const key = 'security_alert_num_times';
let times = await AsyncStorage.getItem(key);
times = times || 0;
console.log({ times });
if (times < 3) {
Alert.alert(
'Security alert',
'If you used BlueWallet prior to version 3.1.0 you are advised to re-create wallets ' +
'and transfer all funds from old wallets to new ones, as older versions might have security issues',
[
{ text: 'Remind me later', onPress: () => AsyncStorage.setItem(key, '0') },
{ text: 'Ok', onPress: () => AsyncStorage.setItem(key, parseInt(times) + 1 + '') },
],
{ cancelable: false },
);
}
}
module.exports.start = start;