How to refresh after updating contents of current note?

I'm writing a plugin that modifies the contents of the current note. In testing, I have to click on a different note and then click back in order to see the changes. How do I force the view to update when the note's contents updates?

I'm using the data API:

await joplin.data.put(['notes', note.id], null, { body: newBody });

I see this has been asked already (I can't include links but search "need to refresh my notes manually") with no reply.

For my use case, it's fine to just insert at the cursor, so that's what I'm doing now (following a post I found by searching "modifying note content"). It still seems like the data API should cause the view to refresh if the current note's body is updated.

1 Like

Not knowing anything about plugin development, but - in general - the easiest way to see the "latest version" of a note is to select / view a different note, and then go back to the note you have changed.

I'm not sure if the whole thing has ever been discussed for put API ... I can't find anything at the moment.

Sorry, but this is not a solution for a plugin!

As a reference how I have solved this in my plugins, if someone is looking for it

Sounds like this is an issue for many. I wonder if a Joplin dev could weigh in?