MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / moveActiveNote

Function moveActiveNote

packages/app-core/src/components/Editor.tsx:713–732  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

711 )
712
713 const moveActiveNote = async (raw: string): Promise<void> => {
714 const state = useStore.getState()
715 const active = state.activeNote
716 if (!active) return
717
718 const value = raw.trim()
719 let target = value
720 if (!target) {
721 target = (await promptApp(buildMoveNotePrompt(active, state.folders))) ?? ''
722 if (!target) return
723 }
724
725 const error = validateMoveNoteTarget(target)
726 if (error) {
727 alertEditorError(error)
728 return
729 }
730 const dest = parseMoveNoteTarget(target)
731 await state.moveNote(active.path, dest.folder, dest.subpath)
732 }
733
734 const runMoveEx = (_cm: unknown, params: { argString?: string } | undefined): void => {
735 void moveActiveNote(params?.argString ?? '')

Callers 1

runMoveExFunction · 0.85

Calls 6

promptAppFunction · 0.90
buildMoveNotePromptFunction · 0.90
validateMoveNoteTargetFunction · 0.90
parseMoveNoteTargetFunction · 0.90
alertEditorErrorFunction · 0.85
moveNoteMethod · 0.65

Tested by

no test coverage detected