File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,13 @@ export default function FSRSConfigForm({
5454 resolver : zodResolver ( formSchema ) ,
5555 } )
5656 const { toast } = useToast ( )
57+ const [ deckId , setDeckId ] = useState < number | null > ( null )
5758
5859 useEffect ( ( ) => {
5960 new Promise < void > ( async ( resolve , reject ) => {
6061 const { deckId } = await client . decks . default . $get ( ) . then ( ( res ) => res . json ( ) )
6162 const resp = await client . decks [ ':did' ] . $get ( { param : { did : String ( deckId ) } } )
63+ setDeckId ( deckId )
6264
6365 if ( ! resp . ok ) {
6466 reject ( signOut ( ) )
@@ -102,7 +104,7 @@ export default function FSRSConfigForm({
102104 setLoading ( true )
103105
104106 const resp = await client . decks [ ':did' ] . $put ( {
105- param : { did : '1' } ,
107+ param : { did : String ( deckId ?? 0 ) } ,
106108 json : {
107109 fsrs : {
108110 request_retention : values . request_retention ,
You can’t perform that action at this time.
0 commit comments