From 85211e8d5c2b25d95be05849c5cab9ab20fabf1c Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Wed, 19 May 2021 16:48:55 +0200 Subject: [PATCH] Mobile: Fixes #4494: Fixed opening URLs that contain non-alphabetical characters --- .../components/NoteBodyViewer/hooks/useOnMessage.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/app-mobile/components/NoteBodyViewer/hooks/useOnMessage.ts b/packages/app-mobile/components/NoteBodyViewer/hooks/useOnMessage.ts index f64e9cf1cf..aab9c3c3d8 100644 --- a/packages/app-mobile/components/NoteBodyViewer/hooks/useOnMessage.ts +++ b/packages/app-mobile/components/NoteBodyViewer/hooks/useOnMessage.ts @@ -3,8 +3,13 @@ const shared = require('@joplin/lib/components/shared/note-screen-shared'); export default function useOnMessage(onCheckboxChange: Function, noteBody: string, onMarkForDownload: Function, onJoplinLinkClick: Function, onResourceLongPress: Function) { return useCallback((event: any) => { - // Since RN 58 (or 59) messages are now escaped twice??? - const msg = unescape(unescape(event.nativeEvent.data)); + // 2021-05-19: Historically this was unescaped twice as it was + // apparently needed after an upgrade to RN 58 (or 59). However this is + // no longer needed and in fact would break certain URLs so it can be + // removed. Keeping the comment here anyway in case we find some URLs + // that end up being broken after removing the double unescaping. + // https://github.com/laurent22/joplin/issues/4494 + const msg = event.nativeEvent.data; console.info('Got IPC message: ', msg);