File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11import type { PracticeCardResponse } from '@/client/types.gen'
22import { v4 as uuidv4 } from 'uuid'
33import { type LocalPracticeSession , db } from '../../db/flashcardsDB'
4- import type { LocalPracticeCard } from '../../db/flashcardsDB'
4+ import type { LocalCard , LocalPracticeCard } from '../../db/flashcardsDB'
55
66export const getLocalPracticeSessions = async (
77 collectionId : string ,
@@ -53,7 +53,7 @@ async function createPracticeSession(
5353 return newSession
5454}
5555
56- async function createPracticeCardsForSession ( sessionId : string , cards : any [ ] ) {
56+ async function createPracticeCardsForSession ( sessionId : string , cards : LocalCard [ ] ) {
5757 const practiceCards : LocalPracticeCard [ ] = cards . map ( ( card ) => ( {
5858 id : uuidv4 ( ) ,
5959 sessionId,
Original file line number Diff line number Diff line change @@ -60,8 +60,9 @@ export function usePracticeSession(collectionId: string) {
6060 isFlipped : false ,
6161 } ) )
6262 }
63- } catch ( err : any ) {
64- setError ( err . message || 'Failed to start session' )
63+ } catch ( err : unknown ) {
64+ console . error ( err )
65+ setError ( 'Failed to start session' )
6566 } finally {
6667 setIsLoading ( false )
6768 startingRef . current = false
@@ -95,8 +96,9 @@ export function usePracticeSession(collectionId: string) {
9596 isFlipped : false ,
9697 }
9798 } )
98- } catch ( err : any ) {
99- setError ( err . message || 'Failed to submit answer' )
99+ } catch ( err : unknown ) {
100+ console . error ( err )
101+ setError ( 'Failed to submit answer' )
100102 } finally {
101103 setIsLoading ( false )
102104 }
You can’t perform that action at this time.
0 commit comments