mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-01-19 05:45:15 +01:00
Merge branch 'master' into alert
This commit is contained in:
commit
35b3625655
@ -6,12 +6,12 @@ import { Platform, useWindowDimensions, Dimensions, I18nManager } from 'react-na
|
||||
import Settings from './screen/settings/Settings';
|
||||
import About from './screen/settings/about';
|
||||
import ReleaseNotes from './screen/settings/releasenotes';
|
||||
import Licensing from './screen/settings/licensing';
|
||||
import Licensing from './screen/settings/Licensing';
|
||||
import Selftest from './screen/selftest';
|
||||
import Language from './screen/settings/language';
|
||||
import Currency from './screen/settings/Currency';
|
||||
import EncryptStorage from './screen/settings/encryptStorage';
|
||||
import PlausibleDeniability from './screen/plausibledeniability';
|
||||
import PlausibleDeniability from './screen/PlausibleDeniability';
|
||||
import LightningSettings from './screen/settings/lightningSettings';
|
||||
import ElectrumSettings from './screen/settings/electrumSettings';
|
||||
import Tools from './screen/settings/tools';
|
||||
|
@ -76,6 +76,8 @@ In another terminal window within the BlueWallet folder:
|
||||
```
|
||||
npx react-native run-ios
|
||||
```
|
||||
**To debug BlueWallet on the iOS Simulator, you must choose a Rosetta-compatible iOS Simulator. This can be done by navigating to the Product menu in Xcode, selecting Destination Architectures, and then opting for "Show Both." This action will reveal the simulators that support Rosetta.
|
||||
**
|
||||
|
||||
* To run on macOS using Mac Catalyst:
|
||||
|
||||
|
@ -14,6 +14,7 @@ import { BlueStorageContext } from '../../blue_modules/storage-context';
|
||||
import { AbstractWallet } from '../../class';
|
||||
import Biometric from '../../class/biometrics';
|
||||
import presentAlert from '../Alert';
|
||||
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
|
||||
const confirm = require('../../helpers/confirm');
|
||||
|
||||
interface AddressItemProps {
|
||||
@ -101,6 +102,7 @@ const AddressItem = ({ item, balanceUnit, walletID, allowSignVerifyMessage }: Ad
|
||||
presentAlert({ message: 'Internal error: cant get WIF from the wallet' });
|
||||
return;
|
||||
}
|
||||
triggerHapticFeedback(HapticFeedbackTypes.Selection);
|
||||
Clipboard.setString(wif);
|
||||
} catch (error: any) {
|
||||
presentAlert({ message: error.message });
|
||||
|
@ -1,6 +1,6 @@
|
||||
PODS:
|
||||
- boost (1.76.0)
|
||||
- BugsnagReactNative (7.22.3):
|
||||
- BugsnagReactNative (7.22.4):
|
||||
- React-Core
|
||||
- BVLinearGradient (2.8.3):
|
||||
- React-Core
|
||||
@ -352,7 +352,7 @@ PODS:
|
||||
- react-native-tcp-socket (6.0.6):
|
||||
- CocoaAsyncSocket
|
||||
- React-Core
|
||||
- react-native-webview (13.7.0):
|
||||
- react-native-webview (13.7.1):
|
||||
- RCT-Folly (= 2021.07.22.00)
|
||||
- React-Core
|
||||
- react-native-widget-center (0.0.9):
|
||||
@ -783,7 +783,7 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
boost: 7dcd2de282d72e344012f7d6564d024930a6a440
|
||||
BugsnagReactNative: d9fa0824cea1beb5ab1f12828d79a2bd1b383e60
|
||||
BugsnagReactNative: 67c786fe8e55e3a4c831f82db5acc0d8222a5fe8
|
||||
BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3
|
||||
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
|
||||
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
|
||||
@ -823,7 +823,7 @@ SPEC CHECKSUMS:
|
||||
react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b
|
||||
react-native-secure-key-store: 910e6df6bc33cb790aba6ee24bc7818df1fe5898
|
||||
react-native-tcp-socket: e724380c910c2e704816ec817ed28f1342246ff7
|
||||
react-native-webview: 4e7d637b43eddec107016d316ae75f7063a3075c
|
||||
react-native-webview: 83525c9ed4138faf5d5e4f8eb74bf050992935be
|
||||
react-native-widget-center: 12dfba20a4fa995850b52cf0afecf734397f4b9c
|
||||
React-NativeModulesApple: c3e696ff867e4bc212266cbdf7e862e48a0166fd
|
||||
React-perflogger: 43287389ea08993c300897a46f95cfac04bb6c1a
|
||||
|
@ -281,6 +281,7 @@
|
||||
"language": "Language",
|
||||
"last_updated": "Last Updated",
|
||||
"language_isRTL": "Restarting BlueWallet is required for the language orientation to take effect.",
|
||||
"license": "License",
|
||||
"lightning_error_lndhub_uri": "Invalid LNDHub URI",
|
||||
"lightning_saved": "Your changes have been saved successfully.",
|
||||
"lightning_settings": "Lightning Settings",
|
||||
|
@ -17,7 +17,7 @@ export const AvailableLanguages: Readonly<TLanguage[]> = Object.freeze([
|
||||
{ label: 'Eesti (ET)', value: 'et' },
|
||||
{ label: 'Ελληνικά (EL)', value: 'el' },
|
||||
{ label: 'فارسی (FA)', value: 'fa', isRTL: true },
|
||||
{ label: 'بختیاری (BQI)', value: 'bqi', isRTL: true },
|
||||
{ label: 'لۊری بختیاری (BQI)', value: 'bqi', isRTL: true },
|
||||
{ label: 'Français (FR)', value: 'fr_fr' },
|
||||
{ label: 'עִברִית (HE)', value: 'he', isRTL: true },
|
||||
{ label: 'Italiano (IT)', value: 'it' },
|
||||
|
28
package-lock.json
generated
28
package-lock.json
generated
@ -11,7 +11,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/preset-env": "^7.20.0",
|
||||
"@bugsnag/react-native": "7.22.3",
|
||||
"@bugsnag/react-native": "7.22.4",
|
||||
"@bugsnag/source-maps": "2.3.1",
|
||||
"@keystonehq/bc-ur-registry": "0.6.4",
|
||||
"@ngraveio/bc-ur": "1.1.6",
|
||||
@ -98,7 +98,7 @@
|
||||
"react-native-tcp-socket": "6.0.6",
|
||||
"react-native-vector-icons": "10.0.3",
|
||||
"react-native-watch-connectivity": "1.1.0",
|
||||
"react-native-webview": "13.7.0",
|
||||
"react-native-webview": "13.7.1",
|
||||
"react-native-widget-center": "https://github.com/BlueWallet/react-native-widget-center#a128c38",
|
||||
"readable-stream": "3.6.2",
|
||||
"realm": "12.6.0",
|
||||
@ -2259,9 +2259,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@bugsnag/react-native": {
|
||||
"version": "7.22.3",
|
||||
"resolved": "https://registry.npmjs.org/@bugsnag/react-native/-/react-native-7.22.3.tgz",
|
||||
"integrity": "sha512-a6bo3Lny3RzunyUmQvhVScQjyDsaxr0DiDQQx10osu/+ysUF+Z9eMOYkUJIHq2r5ZQ2IGuG91Nql51zjjlmWlw==",
|
||||
"version": "7.22.4",
|
||||
"resolved": "https://registry.npmjs.org/@bugsnag/react-native/-/react-native-7.22.4.tgz",
|
||||
"integrity": "sha512-rkIRpw9WEb2WJVkl4ebzgfyqL9NGFN+EnYcN4Eiwfdradcc/V1LOCKuoE6uTuDw3mtWOO+mrgMfW4vtJ+XBdAA==",
|
||||
"dependencies": {
|
||||
"@bugsnag/core": "^7.19.0",
|
||||
"@bugsnag/delivery-react-native": "^7.22.3",
|
||||
@ -20053,9 +20053,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-native-webview": {
|
||||
"version": "13.7.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.7.0.tgz",
|
||||
"integrity": "sha512-pvAaGDxAGrhv9sxvQgpMyLeZrHxGY314lmvp6YakrzdvRa1ZUkAYMgYL3JnogMV6QIvxuFp1AWO1bJxmWmArUw==",
|
||||
"version": "13.7.1",
|
||||
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.7.1.tgz",
|
||||
"integrity": "sha512-tnfTgjIYY3KnBfbN9hRCJf2y/6JZBev3aq2ZacLml0AZn4ufTe4MyCiE1NAZ/l5WHV/1eaqN0srxn45ATL0+Ow==",
|
||||
"dependencies": {
|
||||
"escape-string-regexp": "2.0.0",
|
||||
"invariant": "2.2.4"
|
||||
@ -24211,9 +24211,9 @@
|
||||
"integrity": "sha512-+XDk0OoeM6MZhBh7kEalbRwFuhCZST6Y1jOostfz0fhrmT4FdgQYi1FWcPNsUTcjqv7M48pOFZNx8yWI0lGaYg=="
|
||||
},
|
||||
"@bugsnag/react-native": {
|
||||
"version": "7.22.3",
|
||||
"resolved": "https://registry.npmjs.org/@bugsnag/react-native/-/react-native-7.22.3.tgz",
|
||||
"integrity": "sha512-a6bo3Lny3RzunyUmQvhVScQjyDsaxr0DiDQQx10osu/+ysUF+Z9eMOYkUJIHq2r5ZQ2IGuG91Nql51zjjlmWlw==",
|
||||
"version": "7.22.4",
|
||||
"resolved": "https://registry.npmjs.org/@bugsnag/react-native/-/react-native-7.22.4.tgz",
|
||||
"integrity": "sha512-rkIRpw9WEb2WJVkl4ebzgfyqL9NGFN+EnYcN4Eiwfdradcc/V1LOCKuoE6uTuDw3mtWOO+mrgMfW4vtJ+XBdAA==",
|
||||
"requires": {
|
||||
"@bugsnag/core": "^7.19.0",
|
||||
"@bugsnag/delivery-react-native": "^7.22.3",
|
||||
@ -37709,9 +37709,9 @@
|
||||
}
|
||||
},
|
||||
"react-native-webview": {
|
||||
"version": "13.7.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.7.0.tgz",
|
||||
"integrity": "sha512-pvAaGDxAGrhv9sxvQgpMyLeZrHxGY314lmvp6YakrzdvRa1ZUkAYMgYL3JnogMV6QIvxuFp1AWO1bJxmWmArUw==",
|
||||
"version": "13.7.1",
|
||||
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-13.7.1.tgz",
|
||||
"integrity": "sha512-tnfTgjIYY3KnBfbN9hRCJf2y/6JZBev3aq2ZacLml0AZn4ufTe4MyCiE1NAZ/l5WHV/1eaqN0srxn45ATL0+Ow==",
|
||||
"requires": {
|
||||
"escape-string-regexp": "2.0.0",
|
||||
"invariant": "2.2.4"
|
||||
|
@ -103,9 +103,9 @@
|
||||
"@react-native-async-storage/async-storage": "1.21.0",
|
||||
"@react-native-clipboard/clipboard": "1.13.2",
|
||||
"@react-native-community/push-notification-ios": "1.11.0",
|
||||
"@react-navigation/drawer": "6.6.6",
|
||||
"@react-navigation/native": "6.1.9",
|
||||
"@react-navigation/native-stack": "6.9.17",
|
||||
"@react-navigation/drawer": "6.6.7",
|
||||
"@react-navigation/native": "6.1.10",
|
||||
"@react-navigation/native-stack": "6.9.18",
|
||||
"@remobile/react-native-qrcode-local-image": "https://github.com/BlueWallet/react-native-qrcode-local-image",
|
||||
"@spsina/bip47": "github:BlueWallet/bip47#0a2f02c90350802f2ec93afa4e6c8843be2d687c",
|
||||
"aezeed": "0.0.5",
|
||||
@ -126,7 +126,7 @@
|
||||
"coinselect": "3.1.13",
|
||||
"crypto-js": "4.2.0",
|
||||
"dayjs": "1.11.10",
|
||||
"detox": "20.17.0",
|
||||
"detox": "20.17.1",
|
||||
"ecpair": "2.0.1",
|
||||
"ecurve": "1.0.6",
|
||||
"electrum-client": "github:BlueWallet/rn-electrum-client#1bfe3cc",
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React, { useContext, useState } from 'react';
|
||||
import React, { useContext, useReducer } from 'react';
|
||||
import { ScrollView } from 'react-native';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
|
||||
@ -10,30 +10,57 @@ import presentAlert from '../components/Alert';
|
||||
import Button from '../components/Button';
|
||||
import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback';
|
||||
import SafeArea from '../components/SafeArea';
|
||||
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
||||
const prompt = require('../helpers/prompt');
|
||||
|
||||
const PlausibleDeniability = () => {
|
||||
// Action Types
|
||||
const SET_LOADING = 'SET_LOADING';
|
||||
|
||||
// Defining State and Action Types
|
||||
type State = {
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
type Action = { type: typeof SET_LOADING; payload: boolean };
|
||||
|
||||
// Initial State
|
||||
const initialState: State = {
|
||||
isLoading: false,
|
||||
};
|
||||
|
||||
// Reducer Function
|
||||
function reducer(state: State, action: Action): State {
|
||||
switch (action.type) {
|
||||
case SET_LOADING:
|
||||
return { ...state, isLoading: action.payload };
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
// Component
|
||||
const PlausibleDeniability: React.FC = () => {
|
||||
const { cachedPassword, isPasswordInUse, createFakeStorage, resetWallets } = useContext(BlueStorageContext);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const { popToTop } = useNavigation();
|
||||
const [state, dispatch] = useReducer(reducer, initialState);
|
||||
const navigation = useNavigation<NativeStackNavigationProp<Record<string, object | undefined>>>();
|
||||
|
||||
const handleOnCreateFakeStorageButtonPressed = async () => {
|
||||
setIsLoading(true);
|
||||
dispatch({ type: SET_LOADING, payload: true });
|
||||
try {
|
||||
const p1 = await prompt(loc.plausibledeniability.create_password, loc.plausibledeniability.create_password_explanation);
|
||||
const isProvidedPasswordInUse = p1 === cachedPassword || (await isPasswordInUse(p1));
|
||||
if (isProvidedPasswordInUse) {
|
||||
setIsLoading(false);
|
||||
dispatch({ type: SET_LOADING, payload: false });
|
||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
||||
return presentAlert({ message: loc.plausibledeniability.password_should_not_match });
|
||||
}
|
||||
if (!p1) {
|
||||
setIsLoading(false);
|
||||
dispatch({ type: SET_LOADING, payload: false });
|
||||
return;
|
||||
}
|
||||
const p2 = await prompt(loc.plausibledeniability.retype_password);
|
||||
if (p1 !== p2) {
|
||||
setIsLoading(false);
|
||||
dispatch({ type: SET_LOADING, payload: false });
|
||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationError);
|
||||
return presentAlert({ message: loc.plausibledeniability.passwords_do_not_match });
|
||||
}
|
||||
@ -42,28 +69,24 @@ const PlausibleDeniability = () => {
|
||||
await resetWallets();
|
||||
triggerHapticFeedback(HapticFeedbackTypes.NotificationSuccess);
|
||||
presentAlert({ message: loc.plausibledeniability.success });
|
||||
popToTop();
|
||||
navigation.popToTop();
|
||||
} catch {
|
||||
setIsLoading(false);
|
||||
dispatch({ type: SET_LOADING, payload: false });
|
||||
}
|
||||
};
|
||||
|
||||
return isLoading ? (
|
||||
return state.isLoading ? (
|
||||
<SafeArea>
|
||||
<BlueLoading />
|
||||
</SafeArea>
|
||||
) : (
|
||||
<SafeArea>
|
||||
<BlueCard>
|
||||
<ScrollView maxHeight={450}>
|
||||
<ScrollView>
|
||||
<BlueText>{loc.plausibledeniability.help}</BlueText>
|
||||
|
||||
<BlueText />
|
||||
|
||||
<BlueText>{loc.plausibledeniability.help2}</BlueText>
|
||||
|
||||
<BlueSpacing20 />
|
||||
|
||||
<Button
|
||||
testID="CreateFakeStorageButton"
|
||||
title={loc.plausibledeniability.create_fake_storage}
|
||||
@ -77,6 +100,7 @@ const PlausibleDeniability = () => {
|
||||
|
||||
export default PlausibleDeniability;
|
||||
|
||||
// @ts-ignore: Fix later
|
||||
PlausibleDeniability.navigationOptions = navigationStyle({
|
||||
title: loc.plausibledeniability.title,
|
||||
});
|
@ -1,19 +1,12 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import React from 'react';
|
||||
import { ScrollView } from 'react-native';
|
||||
import navigationStyle from '../../components/navigationStyle';
|
||||
import { BlueCard, BlueText, BlueSpacing20, BlueLoading } from '../../BlueComponents';
|
||||
import { BlueCard, BlueText, BlueSpacing20 } from '../../BlueComponents';
|
||||
import SafeArea from '../../components/SafeArea';
|
||||
import loc from '../../loc';
|
||||
|
||||
const Licensing = () => {
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
setIsLoading(false);
|
||||
}, []);
|
||||
|
||||
return isLoading ? (
|
||||
<BlueLoading />
|
||||
) : (
|
||||
return (
|
||||
<SafeArea>
|
||||
<ScrollView>
|
||||
<BlueCard>
|
||||
@ -46,8 +39,11 @@ const Licensing = () => {
|
||||
);
|
||||
};
|
||||
|
||||
Licensing.navigationOptions = navigationStyle({
|
||||
title: 'License',
|
||||
Licensing.navigationOptions = navigationStyle({}, options => {
|
||||
return {
|
||||
...options,
|
||||
headerTitle: loc.settings.license,
|
||||
};
|
||||
});
|
||||
|
||||
export default Licensing;
|
Loading…
Reference in New Issue
Block a user