diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-07-31 11:17:58 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-07-31 11:17:58 +0200 |
commit | 1bd37ff86e5d5e2397b77c10fcc90e80bfbfce49 (patch) | |
tree | aa8c5ff3fd6927c8e6ee178ce837e50ed7fcb25d /pages/index.tsx | |
parent | 1e4f74c0c8b83068fdc49037064964b8a5a3d6c5 (diff) |
refactoring
Diffstat (limited to 'pages/index.tsx')
-rw-r--r-- | pages/index.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pages/index.tsx b/pages/index.tsx index b414bf8..7c943cf 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -253,16 +253,17 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) { //mouse.highlight: case mouse.local: { if (scope.nodeIds.includes(node.id as string)) { - return + break } setScope((currentScope) => ({ ...currentScope, nodeIds: [...currentScope.nodeIds, node.id as string], })) + break } case mouse.follow: { window.open('org-protocol://roam-node?node=' + node.id, '_self') - return + break } default: break @@ -287,7 +288,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) { setScope({ nodeIds: [emacsNodeId] }) setTimeout(() => { fg?.zoomToFit( - 1000, + 2000, numberWithinRange(20, 200, windowWidth / 8), (node: NodeObject) => getNeighborNodes(emacsNodeId)[node.id!], ) @@ -442,6 +443,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) { const themeContext = useContext<ThemeContextProps>(ThemeContext) const getThemeColor = (name: string) => { + console.log(name) if (!theme) { return } |