mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 15:55:52 +01:00
client: allow the isNoteReadOnly hook operate on a note and context other of the current one
This commit is contained in:
@@ -707,9 +707,8 @@ export function useResizeObserver(ref: RefObject<HTMLElement>, callback: () => v
|
||||
* Indicates that the current note is in read-only mode, while an editing mode is available,
|
||||
* and provides a way to switch to editing mode.
|
||||
*/
|
||||
export function useIsNoteReadOnly() {
|
||||
const {note, noteContext} = useNoteContext();
|
||||
const [isReadOnly, setIsReadOnly] = useState(false);
|
||||
export function useIsNoteReadOnly(note: FNote | null | undefined, noteContext: NoteContext | undefined) {
|
||||
const [isReadOnly, setIsReadOnly] = useState<boolean | undefined>(undefined);
|
||||
|
||||
const enableEditing = useCallback(() => {
|
||||
if (noteContext?.viewScope) {
|
||||
|
||||
Reference in New Issue
Block a user