1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Android: Fixed resource loading issue, and improved logging on desktop

This commit is contained in:
Laurent Cozic
2019-05-24 17:34:18 +01:00
parent 43624ffa75
commit aaaf27af6e
5 changed files with 297 additions and 263 deletions

View File

@ -108,7 +108,7 @@ class NoteBodyViewer extends Component {
const injectedJs = [this.mdToHtml_.injectedJavaScript()];
injectedJs.push(shim.injectedJs('webviewLib'));
injectedJs.push('webviewLib.initialize({ postMessage: postMessage });');
injectedJs.push('webviewLib.initialize({ postMessage: msg => { return postMessage(msg); } });');
injectedJs.push(`
const readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
@ -177,6 +177,8 @@ class NoteBodyViewer extends Component {
onMessage={(event) => {
let msg = event.nativeEvent.data;
console.info('Got IPC message: ', msg);
if (msg.indexOf('checkboxclick:') === 0) {
const newBody = shared.toggleCheckbox(msg, this.props.note.body);
if (this.props.onCheckboxChange) this.props.onCheckboxChange(newBody);