mirror of
https://github.com/LBRYFoundation/lbry-android.git
synced 2025-08-27 07:23:24 +00:00
* first run updates for sync * finish sync implementation and fix build for openssl 1.1.1b required for sdk * fix openssl recipe and tweak build * fix NativeModules import on wallet page * display total wallet balance. fix dispatch prop. * add pipeline status to README.md * remove unused build recipes * hide 'No, thanks' button during email new request * bumpversion 0.6.0 --> 0.6.1 * move unclaimed reward amount to the left of floating wallet balance * Upgrade to React Native 0.59.3 (#513) * upgrade to react native 0.59.3 * add FOREGROUND_SERVICE permission for Android 9 Pie (target sdk 28) * put android.permission.FOREGROUND_SERVICE permission directly in AndroidManifest * allow cleartext traffic * minor copy changes * enable secure password input and auto account_unlock on startup
75 lines
2.2 KiB
JavaScript
75 lines
2.2 KiB
JavaScript
import React from 'react';
|
|
import { Lbry } from 'lbry-redux';
|
|
import {
|
|
ActivityIndicator,
|
|
Linking,
|
|
NativeModules,
|
|
Platform,
|
|
Text,
|
|
TextInput,
|
|
View
|
|
} from 'react-native';
|
|
import AsyncStorage from '@react-native-community/async-storage';
|
|
import Colors from 'styles/colors';
|
|
import Constants from 'constants';
|
|
import firstRunStyle from 'styles/firstRun';
|
|
|
|
class WalletPage extends React.PureComponent {
|
|
state = {
|
|
password: null,
|
|
placeholder: 'password',
|
|
statusTries: 0
|
|
};
|
|
|
|
handleChangeText = (text) => {
|
|
// save the value to the state email
|
|
const { onPasswordChanged } = this.props;
|
|
this.setState({ password: text });
|
|
if (onPasswordChanged) {
|
|
onPasswordChanged(text);
|
|
}
|
|
|
|
if (NativeModules.UtilityModule) {
|
|
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, text);
|
|
// simply set any string value to indicate that a passphrase was set on first run
|
|
AsyncStorage.setItem(Constants.KEY_FIRST_RUN_PASSWORD, "true");
|
|
}
|
|
}
|
|
|
|
render() {
|
|
const { onPasswordChanged, onWalletViewLayout } = this.props;
|
|
|
|
const content = (
|
|
<View onLayout={onWalletViewLayout}>
|
|
<Text style={firstRunStyle.title}>Password</Text>
|
|
<Text style={firstRunStyle.paragraph}>Please enter a password to secure your account and wallet.</Text>
|
|
<TextInput style={firstRunStyle.passwordInput}
|
|
placeholder={this.state.placeholder}
|
|
underlineColorAndroid="transparent"
|
|
secureTextEntry={true}
|
|
value={this.state.password}
|
|
onChangeText={text => this.handleChangeText(text)}
|
|
onFocus={() => {
|
|
if (!this.state.password || this.state.password.length === 0) {
|
|
this.setState({ placeholder: '' });
|
|
}
|
|
}}
|
|
onBlur={() => {
|
|
if (!this.state.password || this.state.password.length === 0) {
|
|
this.setState({ placeholder: 'password' });
|
|
}
|
|
}}
|
|
/>
|
|
<Text style={firstRunStyle.infoParagraph}>Note: for wallet security purposes, LBRY is unable to reset your password.</Text>
|
|
</View>
|
|
);
|
|
|
|
return (
|
|
<View style={firstRunStyle.container}>
|
|
{content}
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default WalletPage;
|