1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00
This commit is contained in:
Laurent Cozic
2020-10-16 16:14:39 +01:00
parent e3a37ec2d6
commit 4e303be85f
24 changed files with 55 additions and 3319 deletions

View File

@ -4,7 +4,7 @@ const shared = require('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???
let msg = unescape(unescape(event.nativeEvent.data));
const msg = unescape(unescape(event.nativeEvent.data));
console.info('Got IPC message: ', msg);
@ -20,7 +20,7 @@ export default function useOnMessage(onCheckboxChange:Function, noteBody:string,
} else if (msg.startsWith('joplin:')) {
onJoplinLinkClick(msg);
} else if (msg.startsWith('error:')) {
console.error('Webview injected script error: ' + msg);
console.error(`Webview injected script error: ${msg}`);
}
}, [onCheckboxChange, noteBody, onMarkForDownload, onJoplinLinkClick, onResourceLongPress]);
}
}