From 6fa61343a3e63a61747bc7123810190057d0bfe4 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 29 Jan 2025 12:14:12 -0500
Subject: cleaned up filter icons.

---
 .../views/collections/CollectionCardDeckView.tsx     | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

(limited to 'src/client/views/collections/CollectionCardDeckView.tsx')

diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index 366d0f448..b40aa37de 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -462,24 +462,13 @@ export class CollectionCardView extends CollectionSubView() {
                     case '6':
                         doc.chatIndex = index;
                         break;
-                    case '1': {
-                        const allHotKeys = Doc.MyFilterHotKeys;
-                        let myTag = '';
+                    case '1':
                         if (tag) {
-                            for (let i = 0; i < allHotKeys.length; i++) {
-                                const keyTag = StrCast(allHotKeys[i].toolType);
-                                if (keyTag.includes(tag)) {
-                                    myTag = keyTag;
-                                    break;
-                                }
-                            }
-
-                            if (myTag) {
-                                TagItem.addTagToDoc(doc, myTag);
-                            }
+                            const hashTag = tag.startsWith('#') ? tag : '#' + tag[0].toLowerCase() + tag.slice(1);
+                            const filterTag = Doc.MyFilterHotKeys.map(key => StrCast(key.toolType)).find(key => key.includes(tag)) ?? hashTag;
+                            TagItem.addTagToDoc(doc, filterTag);
                         }
                         break;
-                    }
                     case '2':
                     case '4':
                         doc.chatFilter = true;
@@ -584,7 +573,6 @@ export class CollectionCardView extends CollectionSubView() {
      * Actually renders all the cards
      */
     @computed get renderCards() {
-        console.log(this.docDraggedIndex, this.childDocs[0].title, this.childDocs[1].title);
         // Map sorted documents to their rendered components
         return this.childDocs.map((doc, index) => {
             const cardsInRow = this.cardsInRowThatIncludesCardIndex(index);
-- 
cgit v1.2.3-70-g09d2

