diff options
author | bobzel <zzzman@gmail.com> | 2025-05-22 11:56:00 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-05-22 11:56:00 -0400 |
commit | eae106461db8bbdf95a8ab3d2a76ba2030ed2148 (patch) | |
tree | a53b8afe03ff2a185840e2a6a36760f96215d69e | |
parent | fdaecd254fe56c5dab5b45258d6595ff9c5bcf42 (diff) |
fixed flashcard ui flip/practice dropdowns.
-rw-r--r-- | env | 7 | ||||
-rw-r--r-- | src/client/views/collections/FlashcardPracticeUI.tsx | 9 |
2 files changed, 12 insertions, 4 deletions
@@ -0,0 +1,7 @@ +_CLIENT_OPENAI_API_KEY='sk-None-qp5q1YBYH0UrPfKPaZs8T3BlbkFJBfbngnegpBt6iRgv07zW' +_CLIENT_OPENAI_KEY='sk-None-qp5q1YBYH0UrPfKPaZs8T3BlbkFJBfbngnegpBt6iRgv07zW' +OPENAI_API_KEY='sk-None-qp5q1YBYH0UrPfKPaZs8T3BlbkFJBfbngnegpBt6iRgv07zW' +_CLIENT_PINECONE_API_KEY='pcsk_7Fhmen_HSo9VM4goUACBx5fmTS6Ku6kTJuZx3q1NeBA8FYc1ve6VTtH4H7vMchRnMwjYTM' +PINECONE_API_KEY='pcsk_2Zyegr_G3nn67rBfrXbSzQV5B8AR3LpVS8QuTo7PAT99uuQwZbxWatSJXgWUCUQ8friVf5' +_CLIENT_FIREFLY_CLIENT_ID='ef5bfe14a470404db1e8b0bbf28de62f' +_CLIENT_FIREFLY_SECRET='p8e-GMrJKLIolXz-H77vrs2uzhvjuPhMh7-L' diff --git a/src/client/views/collections/FlashcardPracticeUI.tsx b/src/client/views/collections/FlashcardPracticeUI.tsx index 2f46c00bd..17b65334c 100644 --- a/src/client/views/collections/FlashcardPracticeUI.tsx +++ b/src/client/views/collections/FlashcardPracticeUI.tsx @@ -61,7 +61,8 @@ export class FlashcardPracticeUI extends ObservableReactComponent<PracticeUIProp get practiceField() { return this._props.fieldKey + "_practice"; } // prettier-ignore @computed get filterDoc() { return DocListCast(Doc.MyContextMenuBtns?.data).find(doc => doc.title === 'Filter'); } // prettier-ignore - @computed get practiceMode() { return this._props.allChildDocs().some(doc => doc._layout_flashcardType) ? StrCast(this._props.layoutDoc.practiceMode) : ''; } // prettier-ignore + @computed get hasFlashcards() { return this._props.allChildDocs().some(doc => doc._layout_flashcardType); } // prettier-ignore + @computed get practiceMode() { return this.hasFlashcards ? StrCast(this._props.layoutDoc.practiceMode) : ''; } // prettier-ignore btnHeight = () => NumCast(this.filterDoc?.height); btnWidth = () => (!this.filterDoc ? 1 : NumCast(this.filterDoc._width)); @@ -130,7 +131,7 @@ export class FlashcardPracticeUI extends ObservableReactComponent<PracticeUIProp const setColor = (mode: practiceMode) => (StrCast(this.practiceMode) === mode ? 'white' : 'lightgray'); const togglePracticeMode = (mode: practiceMode) => this.setPracticeMode(mode === this.practiceMode ? undefined : mode); - return !this._props.allChildDocs().some(doc => doc._layout_flashcardType) ? null : ( + return !this.hasFlashcards ? null : ( <div className="FlashcardPracticeUI-practiceModes" style={{ @@ -141,8 +142,8 @@ export class FlashcardPracticeUI extends ObservableReactComponent<PracticeUIProp type={Type.PRIM} color={SnappingManager.userColor} background={SnappingManager.userVariantColor} + showUntilToggle={false} multiSelect={false} - toggleStatus={!!this.practiceMode} label="Practice" items={[ [practiceMode.QUIZ, 'file-pen', 'Practice flashcards using GPT'], @@ -160,8 +161,8 @@ export class FlashcardPracticeUI extends ObservableReactComponent<PracticeUIProp type={Type.PRIM} color={SnappingManager.userColor} background={SnappingManager.userVariantColor} + showUntilToggle={false} multiSelect={false} - toggleStatus={!!this.practiceMode} label={StrCast(this._props.layoutDoc.revealOp, flashcardRevealOp.FLIP)} items={[ ['reveal', StrCast(this._props.layoutDoc.revealOp) === flashcardRevealOp.SLIDE ? 'expand' : 'question', StrCast(this._props.layoutDoc.revealOp, flashcardRevealOp.FLIP)], |