File tree Expand file tree Collapse file tree
apps/frontend/src/modules/song-upload/components/client/context Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111import { toast } from 'react-hot-toast' ;
1212import { create } from 'zustand' ;
1313
14- import { BG_COLORS , THUMBNAIL_CONSTANTS } from '@nbw/config' ;
14+ import { BG_COLORS , THUMBNAIL_CONSTANTS , UPLOAD_CONSTANTS } from '@nbw/config' ;
1515import { parseSongFromBuffer , type SongFileType } from '@nbw/song' ;
1616import axiosInstance from '@web/lib/axios' ;
1717import { InvalidTokenError , getTokenLocal } from '@web/lib/axios/token.utils' ;
@@ -131,6 +131,14 @@ export const UploadSongProvider = ({
131131 const formMethods = useForm < UploadSongForm > ( {
132132 resolver : zodResolver ( uploadSongFormSchema ) ,
133133 mode : 'onBlur' ,
134+ // Prevents values from appearing empty on first render
135+ defaultValues : {
136+ category : UPLOAD_CONSTANTS . category . default ,
137+ license : UPLOAD_CONSTANTS . license . default ,
138+ visibility : 'public' ,
139+ allowDownload : true ,
140+ customInstruments : [ ] ,
141+ } ,
134142 } ) ;
135143
136144 const {
You can’t perform that action at this time.
0 commit comments