From 08fdd2c4a40df1c241d39b3c945a7cbf2110f780 Mon Sep 17 00:00:00 2001 From: pedr Date: Thu, 12 Dec 2024 21:02:04 -0300 Subject: [PATCH 01/10] if the file is a directory it should be ok to open --- packages/app-desktop/utils/isSafeToOpen.test.ts | 16 +++++++++++++++- packages/app-desktop/utils/isSafeToOpen.ts | 3 +-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/app-desktop/utils/isSafeToOpen.test.ts b/packages/app-desktop/utils/isSafeToOpen.test.ts index fa31489d122..ec43a34195f 100644 --- a/packages/app-desktop/utils/isSafeToOpen.test.ts +++ b/packages/app-desktop/utils/isSafeToOpen.test.ts @@ -1,4 +1,4 @@ -import { remove, writeFile } from 'fs-extra'; +import { mkdirp, remove, writeFile } from 'fs-extra'; import { createTempDir } from '@joplin/lib/testing/test-utils'; import { join } from 'path'; import isSafeToOpen from './isSafeToOpen'; @@ -29,4 +29,18 @@ describe('isSafeToOpen', () => { await remove(tempDir); } }); + + it.each([ + 'folder', + 'name.nice', + ])('should consider folders safe to open', async (fileName) => { + const tempDir = await createTempDir(); + try { + const fullPath = join(tempDir, fileName); + await mkdirp(fullPath); + expect(await isSafeToOpen(fullPath)).toBe(true); + } finally { + await remove(tempDir); + } + }); }); diff --git a/packages/app-desktop/utils/isSafeToOpen.ts b/packages/app-desktop/utils/isSafeToOpen.ts index 2c3ebdcf80b..8515f9c8fdb 100644 --- a/packages/app-desktop/utils/isSafeToOpen.ts +++ b/packages/app-desktop/utils/isSafeToOpen.ts @@ -1,5 +1,4 @@ import { stat } from 'fs-extra'; -import { extname } from 'path'; const isSafeToOpen = async (path: string) => { @@ -176,7 +175,7 @@ const isSafeToOpen = async (path: string) => { } } - if (extname(path) === '' && (await stat(path)).isDirectory()) { + if ((await stat(path)).isDirectory()) { return true; } From 46ee0c0fea8c29a4a942dcd51db86bc12dcd5996 Mon Sep 17 00:00:00 2001 From: pedr Date: Fri, 13 Dec 2024 14:54:45 -0300 Subject: [PATCH 02/10] Revert "if the file is a directory it should be ok to open" This reverts commit 08fdd2c4a40df1c241d39b3c945a7cbf2110f780. --- packages/app-desktop/utils/isSafeToOpen.test.ts | 16 +--------------- packages/app-desktop/utils/isSafeToOpen.ts | 3 ++- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/app-desktop/utils/isSafeToOpen.test.ts b/packages/app-desktop/utils/isSafeToOpen.test.ts index ec43a34195f..fa31489d122 100644 --- a/packages/app-desktop/utils/isSafeToOpen.test.ts +++ b/packages/app-desktop/utils/isSafeToOpen.test.ts @@ -1,4 +1,4 @@ -import { mkdirp, remove, writeFile } from 'fs-extra'; +import { remove, writeFile } from 'fs-extra'; import { createTempDir } from '@joplin/lib/testing/test-utils'; import { join } from 'path'; import isSafeToOpen from './isSafeToOpen'; @@ -29,18 +29,4 @@ describe('isSafeToOpen', () => { await remove(tempDir); } }); - - it.each([ - 'folder', - 'name.nice', - ])('should consider folders safe to open', async (fileName) => { - const tempDir = await createTempDir(); - try { - const fullPath = join(tempDir, fileName); - await mkdirp(fullPath); - expect(await isSafeToOpen(fullPath)).toBe(true); - } finally { - await remove(tempDir); - } - }); }); diff --git a/packages/app-desktop/utils/isSafeToOpen.ts b/packages/app-desktop/utils/isSafeToOpen.ts index 8515f9c8fdb..2c3ebdcf80b 100644 --- a/packages/app-desktop/utils/isSafeToOpen.ts +++ b/packages/app-desktop/utils/isSafeToOpen.ts @@ -1,4 +1,5 @@ import { stat } from 'fs-extra'; +import { extname } from 'path'; const isSafeToOpen = async (path: string) => { @@ -175,7 +176,7 @@ const isSafeToOpen = async (path: string) => { } } - if ((await stat(path)).isDirectory()) { + if (extname(path) === '' && (await stat(path)).isDirectory()) { return true; } From c835a6e6bedd350eaec4dd6242bc2f1e26691421 Mon Sep 17 00:00:00 2001 From: pedr Date: Fri, 13 Dec 2024 17:23:52 -0300 Subject: [PATCH 03/10] adding other message when folder is the target and a test --- .eslintignore | 1 + .gitignore | 1 + packages/app-desktop/bridge.test.ts | 53 +++++++++++++++++++++++++++++ packages/app-desktop/bridge.ts | 15 +++++--- 4 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 packages/app-desktop/bridge.test.ts diff --git a/.eslintignore b/.eslintignore index 94485166b27..34c2be0f773 100644 --- a/.eslintignore +++ b/.eslintignore @@ -146,6 +146,7 @@ packages/app-desktop/InteropServiceHelper.js packages/app-desktop/app.reducer.test.js packages/app-desktop/app.reducer.js packages/app-desktop/app.js +packages/app-desktop/bridge.test.js packages/app-desktop/bridge.js packages/app-desktop/checkForUpdates.js packages/app-desktop/commands/copyDevCommand.js diff --git a/.gitignore b/.gitignore index 5db4a4268da..f09eb25634c 100644 --- a/.gitignore +++ b/.gitignore @@ -122,6 +122,7 @@ packages/app-desktop/InteropServiceHelper.js packages/app-desktop/app.reducer.test.js packages/app-desktop/app.reducer.js packages/app-desktop/app.js +packages/app-desktop/bridge.test.js packages/app-desktop/bridge.js packages/app-desktop/checkForUpdates.js packages/app-desktop/commands/copyDevCommand.js diff --git a/packages/app-desktop/bridge.test.ts b/packages/app-desktop/bridge.test.ts new file mode 100644 index 00000000000..2ebe9152717 --- /dev/null +++ b/packages/app-desktop/bridge.test.ts @@ -0,0 +1,53 @@ +import { createTempDir } from '@joplin/lib/testing/test-utils'; +import bridge, { initBridge } from './bridge'; +import { join } from 'path'; +import { mkdirp } from 'fs-extra'; +import { dialog, shell } from 'electron'; +import ElectronAppWrapper from './ElectronAppWrapper'; + +jest.mock('@sentry/electron/main', () => ({ + init: () => { }, +})); +jest.mock('electron', () => ({ + dialog: { + showMessageBox: jest.fn(() => Promise.resolve()), + }, + shell: { + openExternal: jest.fn(), + openPath: jest.fn(), + }, +})); +describe('bridge', () => { + + beforeAll(async () => { + await initBridge({ + activeWindow: () => {}, + } as ElectronAppWrapper, '', '', '', false); + }); + + it('should open directory if name has no extension', async () => { + const unsafeExtension = 'name'; + + const tempDir = await createTempDir(); + const fullPath = join(tempDir, unsafeExtension); + await mkdirp(fullPath); + + await bridge().openItem(fullPath); + expect(dialog.showMessageBox).toHaveBeenCalledTimes(0); + expect(shell.openPath).toHaveBeenCalledTimes(1); + expect(shell.openPath).toHaveBeenLastCalledWith(fullPath); + }); + + it('should show warning if opening directory has a unsafe extension', async () => { + const unsafeExtension = 'name.unsafe'; + dialog.showMessageBox = jest.fn().mockReturnValue({ response: 1 }); + + const tempDir = await createTempDir(); + const fullPath = join(tempDir, unsafeExtension); + await mkdirp(fullPath); + + await bridge().openItem(fullPath); + expect(dialog.showMessageBox).toHaveBeenCalledTimes(1); + expect(dialog.showMessageBox).toHaveBeenCalledWith(undefined, { 'buttons': ['Cancel', 'Learn more', 'Open it'], 'checkboxLabel': 'Always open ".unsafe" files without asking.', 'message': 'This file seems to be a directory, but Joplin doesn\'t recognise the ".unsafe" extension. Opening this could be dangerous. What would you like to do?', 'title': 'Unknown file type', 'type': 'warning' }); + }); +}); diff --git a/packages/app-desktop/bridge.ts b/packages/app-desktop/bridge.ts index f6f31e0361a..50ba55d73e3 100644 --- a/packages/app-desktop/bridge.ts +++ b/packages/app-desktop/bridge.ts @@ -9,7 +9,7 @@ import * as Sentry from '@sentry/electron/main'; import { ErrorEvent } from '@sentry/types/types'; import { homedir } from 'os'; import { msleep } from '@joplin/utils/time'; -import { pathExists, pathExistsSync, writeFileSync } from 'fs-extra'; +import { pathExists, pathExistsSync, stat, writeFileSync } from 'fs-extra'; import { extname, normalize } from 'path'; import isSafeToOpen from './utils/isSafeToOpen'; import { closeSync, openSync, readSync, statSync } from 'fs'; @@ -431,16 +431,23 @@ export class Bridge { if (await pathExists(fullPath)) { const fileExtension = extname(fullPath); const userAllowedExtension = this.extraAllowedOpenExtensions.includes(fileExtension); - if (userAllowedExtension || await isSafeToOpen(fullPath)) { + + if (userAllowedExtension || (await isSafeToOpen(fullPath))) { return shell.openPath(fullPath); } else { const allowOpenId = 2; const learnMoreId = 1; const fileExtensionDescription = JSON.stringify(fileExtension); + + let warningMessage = _('Joplin doesn\'t recognise the %s extension. Opening this file could be dangerous. What would you like to do?', fileExtensionDescription); + const isDirectory = (await stat(fullPath)).isDirectory(); + if (isDirectory) { + warningMessage = _('This file seems to be a directory, but Joplin doesn\'t recognise the %s extension. Opening this could be dangerous. What would you like to do?', fileExtensionDescription); + } + const result = await dialog.showMessageBox(this.activeWindow(), { title: _('Unknown file type'), - message: - _('Joplin doesn\'t recognise the %s extension. Opening this file could be dangerous. What would you like to do?', fileExtensionDescription), + message: warningMessage, type: 'warning', checkboxLabel: _('Always open %s files without asking.', fileExtensionDescription), buttons: [ From 883036ad0c75ea957736f2a6d2ea7aa6a508b5df Mon Sep 17 00:00:00 2001 From: pedr Date: Mon, 16 Dec 2024 19:34:32 -0300 Subject: [PATCH 04/10] add comment --- packages/app-desktop/bridge.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/app-desktop/bridge.ts b/packages/app-desktop/bridge.ts index 50ba55d73e3..da9bd57e2c2 100644 --- a/packages/app-desktop/bridge.ts +++ b/packages/app-desktop/bridge.ts @@ -440,6 +440,9 @@ export class Bridge { const fileExtensionDescription = JSON.stringify(fileExtension); let warningMessage = _('Joplin doesn\'t recognise the %s extension. Opening this file could be dangerous. What would you like to do?', fileExtensionDescription); + + // We recheck if it is a directory because there is a possibility that the file could be dangerous and a directory + // but we would like to not confuse users about what link is being open const isDirectory = (await stat(fullPath)).isDirectory(); if (isDirectory) { warningMessage = _('This file seems to be a directory, but Joplin doesn\'t recognise the %s extension. Opening this could be dangerous. What would you like to do?', fileExtensionDescription); From eff685f4ca3974cdb66098d46e696f8485fbcab9 Mon Sep 17 00:00:00 2001 From: pedr Date: Tue, 17 Dec 2024 11:02:47 -0300 Subject: [PATCH 05/10] remove unnecessary wrapper --- .../components/screens/encryption-config.tsx | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index b4512113fcf..4884e5bfed9 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -287,18 +287,16 @@ const EncryptionConfigScreen = (props: Props) => { - { - - {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} - { - Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); - }} - > - https://joplinapp.org/help/apps/sync/e2ee - - - } + + {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} + { + Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); + }} + > + https://joplinapp.org/help/apps/sync/e2ee + + {_('Status')} {_('Encryption is: %s', props.encryptionEnabled ? _('Enabled') : _('Disabled'))} From c9bd6182d0df07e109bc13d4821ed84dc1315704 Mon Sep 17 00:00:00 2001 From: pedr Date: Tue, 17 Dec 2024 11:03:44 -0300 Subject: [PATCH 06/10] remove unused parameter --- packages/app-mobile/components/screens/encryption-config.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index 4884e5bfed9..e9b8c792661 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -85,7 +85,7 @@ const EncryptionConfigScreen = (props: Props) => { const decryptedItemsInfo = props.encryptionEnabled ? {decryptedStatText(stats)} : null; - const renderMasterKey = (_num: number, mk: MasterKeyEntity) => { + const renderMasterKey = (mk: MasterKeyEntity) => { const theme = themeStyle(props.themeId); const password = inputPasswords[mk.id] ? inputPasswords[mk.id] : ''; From e34bec8170c279b97c5ab6aa6a6e10c3b015cec5 Mon Sep 17 00:00:00 2001 From: pedr Date: Tue, 17 Dec 2024 11:36:11 -0300 Subject: [PATCH 07/10] adding disabled keys accordion --- .../components/screens/encryption-config.tsx | 72 ++++++++++++------- 1 file changed, 47 insertions(+), 25 deletions(-) diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index e9b8c792661..c4bfe1b5267 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -9,9 +9,10 @@ import time from '@joplin/lib/time'; import { decryptedStatText, enableEncryptionConfirmationMessages, onSavePasswordClick, useInputMasterPassword, useInputPasswords, usePasswordChecker, useStats } from '@joplin/lib/components/EncryptionConfigScreen/utils'; import { MasterKeyEntity } from '@joplin/lib/services/e2ee/types'; import { State } from '@joplin/lib/reducer'; -import { SyncInfo } from '@joplin/lib/services/synchronizer/syncInfoUtils'; +import { masterKeyEnabled, SyncInfo } from '@joplin/lib/services/synchronizer/syncInfoUtils'; import { getDefaultMasterKey, setupAndDisableEncryption, toggleAndSetupEncryption } from '@joplin/lib/services/e2ee/utils'; import { useMemo, useState } from 'react'; +import { Divider, List } from 'react-native-paper'; import shim from '@joplin/lib/shim'; interface Props { @@ -34,8 +35,10 @@ const EncryptionConfigScreen = (props: Props) => { const { passwordChecks, masterPasswordKeys } = usePasswordChecker(props.masterKeys, props.activeMasterKeyId, props.masterPassword, props.passwords); const { inputPasswords, onInputPasswordChange } = useInputPasswords(props.passwords); const { inputMasterPassword, onMasterPasswordSave, onMasterPasswordChange } = useInputMasterPassword(props.masterKeys, props.activeMasterKeyId); + const [showDisabledKeys, setShowDisabledKeys] = useState(false); const mkComps = []; + const disabledMkComps = []; const nonExistingMasterKeyIds = props.notLoadedMasterKeys.slice(); @@ -78,6 +81,10 @@ const EncryptionConfigScreen = (props: Props) => { flex: 1, padding: theme.margin, }, + disabledContainer: { + paddingLeft: theme.margin, + paddingRight: theme.margin, + }, }; return StyleSheet.create(styles); @@ -226,16 +233,19 @@ const EncryptionConfigScreen = (props: Props) => { } }; - - - for (let i = 0; i < props.masterKeys.length; i++) { + for (let i = 0; i < props.masterKeys.filter(mk => masterKeyEnabled(mk)).length; i++) { const mk = props.masterKeys[i]; - mkComps.push(renderMasterKey(i + 1, mk)); + mkComps.push(renderMasterKey(mk)); const idx = nonExistingMasterKeyIds.indexOf(mk.id); if (idx >= 0) nonExistingMasterKeyIds.splice(idx, 1); } + for (let i = 0; i < props.masterKeys.filter(mk => !masterKeyEnabled(mk)).length; i++) { + const mk = props.masterKeys[i]; + disabledMkComps.push(renderMasterKey(mk)); + } + const onToggleButtonClick = async () => { if (props.encryptionEnabled) { const ok = await shim.showConfirmationDialog(_('Disabling encryption means *all* your notes and attachments are going to be re-synchronised and sent unencrypted to the sync target. Do you wish to continue?')); @@ -286,27 +296,39 @@ const EncryptionConfigScreen = (props: Props) => { return ( - - - {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} - { - Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); - }} - > - https://joplinapp.org/help/apps/sync/e2ee - - + + + + {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} + { + Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); + }} + > + https://joplinapp.org/help/apps/sync/e2ee + + - {_('Status')} - {_('Encryption is: %s', props.encryptionEnabled ? _('Enabled') : _('Disabled'))} - {decryptedItemsInfo} - {renderMasterPassword()} - {toggleButton} - {passwordPromptComp} - {mkComps} - {nonExistingMasterKeySection} - + {_('Status')} + {_('Encryption is: %s', props.encryptionEnabled ? _('Enabled') : _('Disabled'))} + {decryptedItemsInfo} + {renderMasterPassword()} + {toggleButton} + {passwordPromptComp} + {mkComps} + {nonExistingMasterKeySection} + + + setShowDisabledKeys(st => !st)} + > + + {disabledMkComps} + + ); From 489aff46a9732d67a2e0afee6bda816bd7fcd2b5 Mon Sep 17 00:00:00 2001 From: pedr Date: Tue, 17 Dec 2024 11:50:43 -0300 Subject: [PATCH 08/10] Revert "adding disabled keys accordion" This reverts commit e34bec8170c279b97c5ab6aa6a6e10c3b015cec5. --- .../components/screens/encryption-config.tsx | 72 +++++++------------ 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index c4bfe1b5267..e9b8c792661 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -9,10 +9,9 @@ import time from '@joplin/lib/time'; import { decryptedStatText, enableEncryptionConfirmationMessages, onSavePasswordClick, useInputMasterPassword, useInputPasswords, usePasswordChecker, useStats } from '@joplin/lib/components/EncryptionConfigScreen/utils'; import { MasterKeyEntity } from '@joplin/lib/services/e2ee/types'; import { State } from '@joplin/lib/reducer'; -import { masterKeyEnabled, SyncInfo } from '@joplin/lib/services/synchronizer/syncInfoUtils'; +import { SyncInfo } from '@joplin/lib/services/synchronizer/syncInfoUtils'; import { getDefaultMasterKey, setupAndDisableEncryption, toggleAndSetupEncryption } from '@joplin/lib/services/e2ee/utils'; import { useMemo, useState } from 'react'; -import { Divider, List } from 'react-native-paper'; import shim from '@joplin/lib/shim'; interface Props { @@ -35,10 +34,8 @@ const EncryptionConfigScreen = (props: Props) => { const { passwordChecks, masterPasswordKeys } = usePasswordChecker(props.masterKeys, props.activeMasterKeyId, props.masterPassword, props.passwords); const { inputPasswords, onInputPasswordChange } = useInputPasswords(props.passwords); const { inputMasterPassword, onMasterPasswordSave, onMasterPasswordChange } = useInputMasterPassword(props.masterKeys, props.activeMasterKeyId); - const [showDisabledKeys, setShowDisabledKeys] = useState(false); const mkComps = []; - const disabledMkComps = []; const nonExistingMasterKeyIds = props.notLoadedMasterKeys.slice(); @@ -81,10 +78,6 @@ const EncryptionConfigScreen = (props: Props) => { flex: 1, padding: theme.margin, }, - disabledContainer: { - paddingLeft: theme.margin, - paddingRight: theme.margin, - }, }; return StyleSheet.create(styles); @@ -233,19 +226,16 @@ const EncryptionConfigScreen = (props: Props) => { } }; - for (let i = 0; i < props.masterKeys.filter(mk => masterKeyEnabled(mk)).length; i++) { + + + for (let i = 0; i < props.masterKeys.length; i++) { const mk = props.masterKeys[i]; - mkComps.push(renderMasterKey(mk)); + mkComps.push(renderMasterKey(i + 1, mk)); const idx = nonExistingMasterKeyIds.indexOf(mk.id); if (idx >= 0) nonExistingMasterKeyIds.splice(idx, 1); } - for (let i = 0; i < props.masterKeys.filter(mk => !masterKeyEnabled(mk)).length; i++) { - const mk = props.masterKeys[i]; - disabledMkComps.push(renderMasterKey(mk)); - } - const onToggleButtonClick = async () => { if (props.encryptionEnabled) { const ok = await shim.showConfirmationDialog(_('Disabling encryption means *all* your notes and attachments are going to be re-synchronised and sent unencrypted to the sync target. Do you wish to continue?')); @@ -296,39 +286,27 @@ const EncryptionConfigScreen = (props: Props) => { return ( - - - - {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} - { - Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); - }} - > - https://joplinapp.org/help/apps/sync/e2ee - - - - {_('Status')} - {_('Encryption is: %s', props.encryptionEnabled ? _('Enabled') : _('Disabled'))} - {decryptedItemsInfo} - {renderMasterPassword()} - {toggleButton} - {passwordPromptComp} - {mkComps} - {nonExistingMasterKeySection} + + + {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} + { + Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); + }} + > + https://joplinapp.org/help/apps/sync/e2ee + - - setShowDisabledKeys(st => !st)} - > - - {disabledMkComps} - - + + {_('Status')} + {_('Encryption is: %s', props.encryptionEnabled ? _('Enabled') : _('Disabled'))} + {decryptedItemsInfo} + {renderMasterPassword()} + {toggleButton} + {passwordPromptComp} + {mkComps} + {nonExistingMasterKeySection} + ); From b5e218eb881f093071ffe11de6e4ebaa443f27cf Mon Sep 17 00:00:00 2001 From: pedr Date: Tue, 17 Dec 2024 11:50:53 -0300 Subject: [PATCH 09/10] Revert "remove unused parameter" This reverts commit c9bd6182d0df07e109bc13d4821ed84dc1315704. --- packages/app-mobile/components/screens/encryption-config.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index e9b8c792661..4884e5bfed9 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -85,7 +85,7 @@ const EncryptionConfigScreen = (props: Props) => { const decryptedItemsInfo = props.encryptionEnabled ? {decryptedStatText(stats)} : null; - const renderMasterKey = (mk: MasterKeyEntity) => { + const renderMasterKey = (_num: number, mk: MasterKeyEntity) => { const theme = themeStyle(props.themeId); const password = inputPasswords[mk.id] ? inputPasswords[mk.id] : ''; From ae1373612a2bc80350769fd75ef63dcc26da9a10 Mon Sep 17 00:00:00 2001 From: pedr Date: Tue, 17 Dec 2024 11:50:56 -0300 Subject: [PATCH 10/10] Revert "remove unnecessary wrapper" This reverts commit eff685f4ca3974cdb66098d46e696f8485fbcab9. --- .../components/screens/encryption-config.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/app-mobile/components/screens/encryption-config.tsx b/packages/app-mobile/components/screens/encryption-config.tsx index 4884e5bfed9..b4512113fcf 100644 --- a/packages/app-mobile/components/screens/encryption-config.tsx +++ b/packages/app-mobile/components/screens/encryption-config.tsx @@ -287,16 +287,18 @@ const EncryptionConfigScreen = (props: Props) => { - - {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} - { - Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); - }} - > - https://joplinapp.org/help/apps/sync/e2ee - - + { + + {_('For more information about End-To-End Encryption (E2EE) and advice on how to enable it please check the documentation:')} + { + Linking.openURL('https://joplinapp.org/help/apps/sync/e2ee'); + }} + > + https://joplinapp.org/help/apps/sync/e2ee + + + } {_('Status')} {_('Encryption is: %s', props.encryptionEnabled ? _('Enabled') : _('Disabled'))}