File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,9 +148,9 @@ function FlashcardsViewer() {
148148 < button
149149 onClick = { ( ) => handleGenerateFlashcards ( ) }
150150 disabled = {
151- ! note . content . trim ( ) ||
151+ ! note ? .content . trim ( ) ||
152152 isGenerating ||
153- note . content . trim ( ) . split ( / \s + / ) . length < 70
153+ note ? .content . trim ( ) . split ( / \s + / ) . length < 70
154154 }
155155 className = "group btn-primary btn-icon whitespace-nowrap"
156156 >
@@ -162,7 +162,7 @@ function FlashcardsViewer() {
162162 < span > Regenerate Flashcards</ span >
163163
164164 { /* Tooltip inside the button */ }
165- { ! isGenerating && note . content . trim ( ) . split ( / \s + / ) . length < 70 && (
165+ { ! isGenerating && note ? .content . trim ( ) . split ( / \s + / ) . length < 70 && (
166166 < div className = "absolute left-1/2 -top-10 transform -translate-x-1/2 bg-black text-white text-xs rounded py-1 px-2 opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap pointer-events-none" >
167167 Requires at least 70 words
168168 </ div >
Original file line number Diff line number Diff line change @@ -206,7 +206,9 @@ function NotesPage() {
206206
207207 // if (userData.usagesLeft <= 0 && nextReset - new Date() >= 0) {
208208 toast . success (
209- `Summary generated! ${ userData . usagesLeft - 1 } credits remaining.`
209+ `Summary generated! ${
210+ userData . usagesLeft == - 1 ? "4" : userData . usagesLeft - 1
211+ } credits remaining.`
210212 ) ;
211213 } catch ( error ) {
212214 // no more usages left
You can’t perform that action at this time.
0 commit comments