Skip to content

Build your personal knowledge base with Trilium Notes

fix(mermaid): toggle read-only for protected note

Elian Doran72c024fc261e
diff --git a/src/public/app/widgets/floating_buttons/toggle_read_only_button.ts b/src/public/app/widgets/floating_buttons/toggle_read_only_button.ts
index 37a99217ec..f436c820c1 100644
--- a/src/public/app/widgets/floating_buttons/toggle_read_only_button.ts
+++ b/src/public/app/widgets/floating_buttons/toggle_read_only_button.ts
@@ -41,6 +41,7 @@ export default class ToggleReadOnlyButton extends OnClickButtonWidget {
isEnabled() {
return super.isEnabled()
&& this.note?.type === "mermaid"
+ && this.note?.isContentAvailable()
&& this.noteContext?.viewScope?.viewMode === "default";
}