diff options
| author | bobzel <zzzman@gmail.com> | 2024-09-19 17:50:48 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-09-19 17:50:48 -0400 |
| commit | 3c8af89e3d5370b748fea27c411b3e62758b9a45 (patch) | |
| tree | 38341e3d27cf52a0fcfdba467eaac4565c3c8c0e /src/client/views/collections/CollectionCardDeckView.tsx | |
| parent | 865b8b57f0fe352afdb980d1104da8d297a10559 (diff) | |
changed backend for filtering buttons to store only one list - the list of icon buttons in Doc.MyFilterHotKeys.
Diffstat (limited to 'src/client/views/collections/CollectionCardDeckView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionCardDeckView.tsx | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx index cab7d51e4..bcb42111f 100644 --- a/src/client/views/collections/CollectionCardDeckView.tsx +++ b/src/client/views/collections/CollectionCardDeckView.tsx @@ -328,24 +328,22 @@ export class CollectionCardView extends CollectionSubView() { */ tagValue = (doc: Doc) => { - const keys = StrListCast(Doc.UserDoc().myFilterHotKeyTitles); + const keys = Doc.MyFilterHotKeys; - const isTagActive = (buttonID: number) => { - return BoolCast(doc[StrCast(Doc.UserDoc()[keys[buttonID]])]); - }; + const isTagActive = (key: Doc) => BoolCast(key.active); let base = ''; let fraction = ''; - for (let i = 0; i < keys.length; i++) { - if (isTagActive(i)) { + keys.forEach(key => { + if (isTagActive(key)) { if (base === '') { - base = i.toString(); // First active tag becomes the base + base = StrCast(key.toolType); // First active tag becomes the base } else { - fraction += i.toString(); // Subsequent active tags become part of the fraction + fraction += StrCast(key.toolType); // Subsequent active tags become part of the fraction } } - } + }); // If no tag was active, return 0 by default if (base === '') { @@ -553,17 +551,16 @@ export class CollectionCardView extends CollectionSubView() { doc.chatIndex = index; break; case '1': { - const allHotKeys = StrListCast(Doc.UserDoc().myFilterHotKeyTitles); + const allHotKeys = Doc.MyFilterHotKeys; let myTag = ''; if (tag) { for (let i = 0; i < allHotKeys.length; i++) { - if (tag.includes(allHotKeys[i])) { - myTag = StrCast(Doc.UserDoc()[allHotKeys[i]]); - break; - } else if (tag.includes(StrCast(Doc.UserDoc()[allHotKeys[i]]))) { - myTag = StrCast(Doc.UserDoc()[allHotKeys[i]]); + // bcz: CHECK THIS CODE OUT -- SOMETHING CHANGED + const keyTag = StrCast(allHotKeys[i].toolType); + if (tag.includes(keyTag)) { + myTag = keyTag; break; } } |
