diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-10-04 15:34:56 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-10-04 15:34:56 +0200 |
commit | b0ddf286f087b31dc75626f709cfce3889de25dd (patch) | |
tree | 480c65853ef0a8e2de44f567ec95e367fc634a04 /components/contextmenu.tsx | |
parent | 90820ca13a51b8a7e77d15896b0d34f9aba829fd (diff) |
feat(preview): changed text-retrieval to http
Diffstat (limited to 'components/contextmenu.tsx')
-rw-r--r-- | components/contextmenu.tsx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/components/contextmenu.tsx b/components/contextmenu.tsx index ff3dd81..09d9cff 100644 --- a/components/contextmenu.tsx +++ b/components/contextmenu.tsx @@ -43,7 +43,7 @@ import { } from '@chakra-ui/icons' import { OrgRoamGraphReponse, OrgRoamLink, OrgRoamNode } from '../api' -import { getOrgText, deleteNodeInEmacs, openNodeInEmacs, createNodeInEmacs } from "../util/webSocketFunctions" +import { deleteNodeInEmacs, openNodeInEmacs, createNodeInEmacs } from '../util/webSocketFunctions' export default interface ContextMenuProps { background: Boolean @@ -54,7 +54,7 @@ export default interface ContextMenuProps { menuClose: () => void scope: { nodeIds: string[] } webSocket: any - setPreviewNode: any, + setPreviewNode: any } export const ContextMenu = (props: ContextMenuProps) => { @@ -67,7 +67,7 @@ export const ContextMenu = (props: ContextMenuProps) => { menuClose, scope, webSocket, - setPreviewNode, + setPreviewNode, } = props const { isOpen, onOpen, onClose } = useDisclosure() const copyRef = useRef<any>() @@ -101,7 +101,10 @@ export const ContextMenu = (props: ContextMenuProps) => { </> )} {!node?.properties.FILELESS ? ( - <MenuItem icon={<EditIcon />} onClick={() => openNodeInEmacs(node as OrgRoamNode, webSocket)}> + <MenuItem + icon={<EditIcon />} + onClick={() => openNodeInEmacs(node as OrgRoamNode, webSocket)} + > Open in Emacs </MenuItem> ) : ( @@ -156,8 +159,13 @@ export const ContextMenu = (props: ContextMenuProps) => { Permenantly delete note </MenuItem> )} - <MenuItem onClick={() => {getOrgText(node!, webSocket) - setPreviewNode(node)}}>Preview</MenuItem> + <MenuItem + onClick={() => { + setPreviewNode(node) + }} + > + Preview + </MenuItem> </MenuList> </Menu> </Box> |