1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

All: Security: Added way to upgrade master key encryption and sync target encryption

This commit is contained in:
Laurent Cozic
2020-03-13 17:42:50 +00:00
parent 3917e3469d
commit f4958de885
17 changed files with 423 additions and 164 deletions

View File

@ -31,10 +31,6 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
this.styles_ = {};
}
componentDidMount() {
this.isMounted_ = true;
}
componentWillUnmount() {
this.isMounted_ = false;
}
@ -47,12 +43,13 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
return shared.refreshStats(this);
}
UNSAFE_componentWillMount() {
this.initState(this.props);
componentDidMount() {
this.isMounted_ = true;
shared.componentDidMount(this);
}
UNSAFE_componentWillReceiveProps(nextProps) {
this.initState(nextProps);
componentDidUpdate(prevProps) {
shared.componentDidUpdate(this, prevProps);
}
async checkPasswords() {
@ -110,7 +107,7 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
return shared.onPasswordChange(this, mk, text);
};
const password = this.state.passwords[mk.id] ? this.state.passwords[mk.id] : '';
const password = this.props.passwords[mk.id] ? this.props.passwords[mk.id] : '';
const passwordOk = this.state.passwordChecks[mk.id] === true ? '✔' : '❌';
const inputStyle = { flex: 1, marginRight: 10, color: theme.color };
@ -196,7 +193,7 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
render() {
const theme = themeStyle(this.props.theme);
const masterKeys = this.state.masterKeys;
const masterKeys = this.props.masterKeys;
const decryptedItemsInfo = this.props.encryptionEnabled ? <Text style={this.styles().normalText}>{shared.decryptedStatText(this)}</Text> : null;
const mkComps = [];