aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authoraidahosa1 <aisosa_idahosa@brown.edu>2024-05-18 02:49:43 -0400
committeraidahosa1 <aisosa_idahosa@brown.edu>2024-05-18 02:49:43 -0400
commit68b00ed7e782fd237cdcdcb30f55814874854187 (patch)
tree7f9e7b94d670381734f93fd4beb1927ee6e8a523 /src/client/views/collections
parente168e0e880db808589d4c0a85e37c30b177bdb8e (diff)
perchance time to pull
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionCardDeckView.tsx23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx
index 8a63fc6d9..2ca03a40d 100644
--- a/src/client/views/collections/CollectionCardDeckView.tsx
+++ b/src/client/views/collections/CollectionCardDeckView.tsx
@@ -26,6 +26,7 @@ import { GPTPopupMode } from '../pdf/GPTPopup/GPTPopup';
import { reaction } from 'mobx';
import { NumListCast } from '../../../fields/Doc';
import { undoBatch } from '../../util/UndoManager';
+import { CalendarContainer } from 'react-datepicker';
@observer
export class CollectionCardView extends CollectionSubView() {
@@ -52,7 +53,7 @@ export class CollectionCardView extends CollectionSubView() {
return false;
}
// Get the group number for the current index from the customGroupDictionary
- const groupNumber = this.customGroupDictionary[currCustom].get(index);
+ const groupNumber = this.getButtonGroup(currCustom, l.layout)
// Check if the group number is in the active groups
return groupNumber !== undefined && activeGroups.includes(groupNumber);
});
@@ -319,8 +320,8 @@ export class CollectionCardView extends CollectionSubView() {
break;
case 'custom':
- typeA = this.customGroupDictionary[NumCast(this._props.Document.customSortNumber)].get(docs.indexOf(docA)) ?? '9999';
- typeB = this.customGroupDictionary[NumCast(this._props.Document.customSortNumber)].get(docs.indexOf(docB)) ?? '9999';
+ typeA = this.getButtonGroup(NumCast(this._props.Document.customSortNumber), docA.layout) ?? '9999'
+ typeB = this.getButtonGroup(NumCast(this._props.Document.customSortNumber), docB.layout) ?? '9999'
break;
case 'gpt':
@@ -411,6 +412,7 @@ export class CollectionCardView extends CollectionSubView() {
* @returns
*/
translateOverflowX(realIndex: number, calcIndex: number, calcRowCards: number) {
+
if (realIndex < this.maxRowCount) {
return 0;
}
@@ -683,7 +685,7 @@ export class CollectionCardView extends CollectionSubView() {
const groupNumber = NumCast(this._props.Document.customSortNumber);
let amButtons = 4;
- let activeButtonIndex = this.customGroupDictionary[groupNumber].get(childPairIndex);
+ let activeButtonIndex = this.getButtonGroup(groupNumber, doc)
if (isChat && doc) {
if (this.amGPTGroups > 4){
@@ -711,6 +713,19 @@ export class CollectionCardView extends CollectionSubView() {
);
}
+ getButtonGroup(groupNumber: number, doc: Doc) {
+ switch (groupNumber){
+ case 0:
+ return NumCast(doc.custom1Group)
+ case 1:
+ return NumCast(doc.custom2Group)
+ case 2:
+ return NumCast(doc.custom3Group)
+ default:
+ break
+ }
+ }
+
@computed get translateWrapperX() {
let translate = 0;