client: allow the isNoteReadOnly hook operate on a note and context other of the current one

This commit is contained in:
Adorian Doran
2025-11-06 07:48:11 +02:00
parent 914fa3625f
commit 4fdb502a19
3 changed files with 5 additions and 6 deletions

View File

@@ -101,7 +101,7 @@ function ToggleReadOnlyButton({ note, viewType, isDefaultViewMode }: FloatingBut
function EditButton({ note, noteContext, isDefaultViewMode }: FloatingButtonContext) {
const [animationClass, setAnimationClass] = useState("");
const {isReadOnly, enableEditing} = useIsNoteReadOnly();
const {isReadOnly, enableEditing} = useIsNoteReadOnly(note, noteContext);
// make the edit button stand out on the first display, otherwise
// it's difficult to notice that the note is readonly