diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx
index ea5973d4e..6e885535b 100644
--- a/packages/app-mobile/components/screens/encryption-config.tsx
+++ b/packages/app-mobile/components/screens/encryption-config.tsx
@@ -106,7 +106,7 @@ const EncryptionConfigScreen = (props: Props) => {
onInputPasswordChange(mk, text)} style={inputStyle}>
{passwordOk}
-
+
);
}
diff --git a/packages/app-mobile/root.tsx b/packages/app-mobile/root.tsx
index 887a57bdc..e29b45b49 100644
--- a/packages/app-mobile/root.tsx
+++ b/packages/app-mobile/root.tsx
@@ -476,7 +476,7 @@ async function initialize(dispatch: Function) {
if (Setting.value('env') == 'prod') {
await db.open({ name: 'joplin.sqlite' });
} else {
- await db.open({ name: 'joplin-104.sqlite' });
+ await db.open({ name: 'joplin-107.sqlite' });
// await db.clearForTesting();
}
@@ -492,6 +492,10 @@ async function initialize(dispatch: Function) {
// Setting.setValue('sync.10.userContentPath', 'https://joplinusercontent.com');
Setting.setValue('sync.10.path', 'http://api.joplincloud.local:22300');
Setting.setValue('sync.10.userContentPath', 'http://joplinusercontent.local:22300');
+
+ Setting.setValue('sync.target', 10);
+ Setting.setValue('sync.10.username', 'user1@example.com');
+ Setting.setValue('sync.10.password', 'hunter1hunter2hunter3');
}
if (!Setting.value('clientId')) Setting.setValue('clientId', uuid.create());
diff --git a/packages/lib/components/EncryptionConfigScreen/utils.ts b/packages/lib/components/EncryptionConfigScreen/utils.ts
index 1a3ce0bf5..bede33a86 100644
--- a/packages/lib/components/EncryptionConfigScreen/utils.ts
+++ b/packages/lib/components/EncryptionConfigScreen/utils.ts
@@ -96,6 +96,13 @@ export const onSavePasswordClick = (mk: MasterKeyEntity, passwords: Record {
@@ -141,6 +148,11 @@ export const useInputPasswords = (propsPasswords: Record) => {
export const usePasswordChecker = (masterKeys: MasterKeyEntity[], activeMasterKeyId: string, masterPassword: string, passwords: Record) => {
const [passwordChecks, setPasswordChecks] = useState({});
+
+ // "masterPasswordKeys" are the master key that can be decrypted with the
+ // master password. It should be all of them normally, but in previous
+ // versions it was possible to have different passwords for different keys,
+ // so we need this for backward compatibility.
const [masterPasswordKeys, setMasterPasswordKeys] = useState({});
const [masterPasswordStatus, setMasterPasswordStatus] = useState(MasterPasswordStatus.Unknown);
@@ -167,7 +179,6 @@ export const usePasswordChecker = (masterKeys: MasterKeyEntity[], activeMasterKe
setMasterPasswordKeys(masterPasswordKeys => {
if (JSON.stringify(newMasterPasswordKeys) === JSON.stringify(masterPasswordKeys)) return masterPasswordKeys;
- console.info('====', JSON.stringify(newMasterPasswordKeys), JSON.stringify(masterPasswordKeys));
return newMasterPasswordKeys;
});