mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
REF: Throw alert
This commit is contained in:
parent
b9d188c1d1
commit
3f6e3b5408
@ -246,7 +246,7 @@
|
||||
"about_release_notes": "Release notes",
|
||||
"about_review": "Leave us a review",
|
||||
"about_selftest": "Run self-test",
|
||||
"about_selftest_electrum_disabled": "Offline mode enabled. Unable to proceed with tests. Please disable Offline Mode and try again.",
|
||||
"about_selftest_electrum_disabled": "Self testing is not available with Electrum Offline Mode. Please disable offline mode and try again.",
|
||||
"about_selftest_ok": "All internal tests have passed successfully. The wallet works well.",
|
||||
"about_sm_github": "GitHub",
|
||||
"about_sm_discord": "Discord Server",
|
||||
|
@ -15,7 +15,6 @@ import {
|
||||
HDAezeedWallet,
|
||||
SLIP39LegacyP2PKHWallet,
|
||||
} from '../class';
|
||||
import { BlueStorageContext } from '../blue_modules/storage-context';
|
||||
const bitcoin = require('bitcoinjs-lib');
|
||||
const BlueCrypto = require('react-native-blue-crypto');
|
||||
const encryption = require('../blue_modules/encryption');
|
||||
@ -28,7 +27,6 @@ const styles = StyleSheet.create({
|
||||
});
|
||||
|
||||
export default class Selftest extends Component {
|
||||
static contextType = BlueStorageContext;
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@ -57,10 +55,6 @@ export default class Selftest extends Component {
|
||||
|
||||
//
|
||||
|
||||
if (this.context.isElectrumDisabled) {
|
||||
throw new Error(loc.settings.about_selftest_electrum_disabled);
|
||||
}
|
||||
|
||||
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
||||
await BlueElectrum.ping();
|
||||
await BlueElectrum.waitTillConnected();
|
||||
|
@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
/* global alert */
|
||||
import React, { useContext } from 'react';
|
||||
import { TouchableOpacity, ScrollView, Linking, Image, View, Text, StyleSheet, useWindowDimensions, Platform } from 'react-native';
|
||||
import { useNavigation, useTheme } from '@react-navigation/native';
|
||||
import { Icon } from 'react-native-elements';
|
||||
@ -10,11 +11,13 @@ import navigationStyle from '../../components/navigationStyle';
|
||||
import loc, { formatStringAddTwoWhiteSpaces } from '../../loc';
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import Bugsnag from '@bugsnag/react-native';
|
||||
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
||||
|
||||
const About = () => {
|
||||
const { navigate } = useNavigation();
|
||||
const { colors } = useTheme();
|
||||
const { width, height } = useWindowDimensions();
|
||||
const { isElectrumDisabled } = useContext(BlueStorageContext);
|
||||
const styles = StyleSheet.create({
|
||||
copyToClipboard: {
|
||||
justifyContent: 'center',
|
||||
@ -75,7 +78,11 @@ const About = () => {
|
||||
};
|
||||
|
||||
const handleOnSelfTestPress = () => {
|
||||
navigate('Selftest');
|
||||
if (isElectrumDisabled) {
|
||||
alert(loc.settings.about_selftest_electrum_disabled);
|
||||
} else {
|
||||
navigate('Selftest');
|
||||
}
|
||||
};
|
||||
|
||||
const handleOnLicensingPress = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user