Manually clear undo history

I am writing an electron note taking app and for the menu I am using the built in undo/redo roles. The problem is that with their current functionality the undo “history” persists across notes such that pressing “Ctrl+Z” on a freshly opened note would restore the text of the previous note.

Is there anyway I can clear this undo “history”? I tried remote.getCurrentWebContents().clearHistory() however this doesn’t appear to work.

Thank you to anyone who replies!