Skip to content

Build your personal knowledge base with Trilium Notes

refresh button state change on note update

zadam7f2755d4a05b
diff --git a/src/public/app/widgets/run_script_buttons.js b/src/public/app/widgets/run_script_buttons.js
index a94a1e54fc..f74b96be4c 100644
--- a/src/public/app/widgets/run_script_buttons.js
+++ b/src/public/app/widgets/run_script_buttons.js
@@ -20,7 +20,13 @@ export default class RunScriptButtonsWidget extends TabAwareWidget {
}
refreshWithNote(note) {
- this.$renderButton.toggle(note.type === 'render');
+ this.$renderButton.toggle(note.type === 'render');console.log("note.mime", note.mime);
this.$executeScriptButton.toggle(note.mime.startsWith('application/javascript'));
}
+
+ async entitiesReloadedEvent({loadResults}) {
+ if (loadResults.isNoteReloaded(this.noteId)) {
+ this.refresh();
+ }
+ }
}
\ No newline at end of file