From 302b9ab98001a50ca2117df823216a99b7c25869 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 19 Sep 2024 20:03:49 -0400
Subject: changed carousel to set #star tags instead of a metaadata field.

---
 src/client/views/FilterPanel.tsx | 41 +++++++++-------------------------------
 1 file changed, 9 insertions(+), 32 deletions(-)

(limited to 'src/client/views/FilterPanel.tsx')

diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index a3c8fc383..e34b66963 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -40,38 +40,17 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel
         isEditing: false,
         myHotKey: hotKey,
 
-        toggleActive() {
-            this.isActive = !this.isActive;
-        },
-        deactivate() {
-            this.isActive = false;
-        },
-        startEditing() {
-            this.isEditing = true;
-        },
-        stopEditing() {
-            this.isEditing = false;
-        },
-        setHotKey(newHotKey: string) {
-            this.myHotKey.title = newHotKey;
-        },
-    }));
+        toggleActive() { this.isActive = !this.isActive; },
+        deactivate()   { this.isActive = false; },
+        startEditing() { this.isEditing = true; },
+        stopEditing()  { this.isEditing = false; },
+        setHotKey(newHotKey: string) { this.myHotKey.title = newHotKey; },
+    })); // prettier-ignore
 
     const panelRef = useRef<HTMLDivElement>(null);
     const inputRef = useRef<HTMLInputElement>(null);
 
-    const handleClick = () => {
-        state.toggleActive();
-    };
-
-    const buttons = DocCast(Doc.UserDoc().myContextMenuBtns);
-
-    /**
-     * Removes a hotkey from list
-     */
-    const removeHotKey = () => {
-        Doc.RemFromFilterHotKeys(hotKey);
-    };
+    const handleClick = () => state.toggleActive();
 
     /**
      * Updates the list of hotkeys based on the users input. replaces the old title with the new one and then assigns this new
@@ -99,9 +78,7 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel
 
     useEffect(() => {
         document.addEventListener('mousedown', handleClickOutside);
-        return () => {
-            document.removeEventListener('mousedown', handleClickOutside);
-        };
+        return () => document.removeEventListener('mousedown', handleClickOutside);
     }, []);
 
     const iconOpts = ['star', 'heart', 'bolt', 'satellite', 'palette', 'robot', 'lightbulb', 'highlighter', 'book', 'chalkboard'] as IconProp[];
@@ -172,7 +149,7 @@ const HotKeyIconButton: React.FC<HotKeyButtonProps> = observer(({ hotKey /*, sel
                 className="hotKey-close"
                 onClick={(e: React.MouseEvent) => {
                     e.stopPropagation();
-                    removeHotKey();
+                    Doc.RemFromFilterHotKeys(hotKey);
                 }}>
                 <FontAwesomeIcon icon={'x' as IconProp} color={SnappingManager.userColor} />
             </button>
-- 
cgit v1.2.3-70-g09d2

