From d53af1704c33192e696d71143fa4895176a1e28a Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Tue, 3 Aug 2021 16:30:49 +0200
Subject: feature: citelink highlight color

---
 pages/index.tsx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'pages/index.tsx')

diff --git a/pages/index.tsx b/pages/index.tsx
index 70f895a..02be883 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -411,6 +411,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
 
   const hiddenNodeIdsRef = useRef<NodeById>({})
   const filteredGraphData = useMemo(() => {
+    hiddenNodeIdsRef.current = {}
     const filteredNodes = graphData.nodes
       .filter((nodeArg) => {
         const node = nodeArg as OrgRoamNode
@@ -580,6 +581,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
       visuals.nodeHighlight || [],
       visuals.citeNodeColor || [],
       visuals.citeLinkColor || [],
+      visuals.citeLinkHighlightColor || [],
     )
 
     return Object.fromEntries(
@@ -805,8 +807,10 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
       const needsHighlighting = linkIsHighlighted || linkWasHighlighted
       const roamLink = link as OrgRoamLink
       if (visuals.citeLinkColor && roamLink.type === 'cite') {
-        return needsHighlighting
-          ? '#ffffff' /*highlightColors[visuals.citeLinkColor][visuals.citeLinkHighlightColor] */
+        return needsHighlighting && (visuals.citeLinkHighlightColor || visuals.linkHighlight)
+          ? highlightColors[visuals.citeLinkColor][
+              visuals.citeLinkHighlightColor || visuals.linkHighlight
+            ](opacity)
           : getThemeColor(visuals.citeLinkColor)
       }
 
-- 
cgit v1.2.3

