I’m trying to make it so that my buttons will only show up if they can be used with the notetype of the note being loaded into the editor. However, the buttons are created before the note is loaded. So when the editor_did_init_buttons hook fires, the given editor.note is still null and I can’t check for the notetype.
def add_audio(editor: Editor):
def add_audio_btn(buttons: List[str], editor: Editor):
if not has_fields(editor.note.note_type()): # <- doesnt work because its always null
buttons += [editor.addButton("", "add_audio", add_audio, "", "Add Audio")]