I'm developing a small plugin to have a persistent counter in a note that can be clicked from the viewer to be increased. I'm doing it as a markdown-it plugin and for the counter to be persistent, I'm using joplin.data.put... to update the current count within the fence block.
This is working great on my laptop, however on mobile the note content isn't really updated until the note is closed. This means that I can't press the button twice in a row. If I click to edit the note after pressing the button, I can see that the content hasn't been updated and the effect of the button press is lost.
Is there anything special I need to do on mobile to invoke the changes of the updated note body?
Does it help to use the editor.setText
command instead? I'm not sure if the editor is just hidden on mobile (in which it would work) or actually removed (in which case it won't). Maybe we should have a joplin.workspace.setNote()
to simplify this kind of use case
Thanks for the suggestion, but no editor.setText
doesn't work at all, the change is never saved on mobile.
Having a special command for this kind of use case would be great, I feel like it would be very useful for lots of plugins. In the mean time, I will just reopen the note each time 
Edit: I just noticed that editor.setText
even throws an error on mobile, Error: Cannot execute a command without a runtime: editor.setText (Calling api.joplin.commands.execute)
. So, it seems like the editor is completely removed on mobile.