@@ -143,6 +143,12 @@ export const GrantForm = ({
143143 } ,
144144 } ) ;
145145
146+ const { data : participantData } = useParticipantDataQuery ( {
147+ variables : {
148+ conference : conference ,
149+ } ,
150+ } ) ;
151+
146152 const inputPlaceholderText = useTranslatedMessage ( "input.placeholder" ) ;
147153 const { user, loading : loadingUser } = useCurrentUser ( { } ) ;
148154 const [ formState , formOptions ] = useFormState < GrantFormFields > (
@@ -202,33 +208,37 @@ export const GrantForm = ({
202208 formState . setField ( "notes" , grant . notes ) ;
203209 formState . setField ( "travellingFrom" , grant . travellingFrom ) ;
204210
205- if ( grant . participant ) {
206- formState . setField ( "participantBio" , grant . participant . bio ) ;
207- formState . setField ( "participantWebsite" , grant . participant . website ) ;
208- formState . setField (
209- "participantTwitterHandle" ,
210- grant . participant . twitterHandle ,
211- ) ;
212- formState . setField (
213- "participantInstagramHandle" ,
214- grant . participant . instagramHandle ,
215- ) ;
216- formState . setField (
217- "participantLinkedinUrl" ,
218- grant . participant . linkedinUrl ,
219- ) ;
220- formState . setField (
221- "participantFacebookUrl" ,
222- grant . participant . facebookUrl ,
223- ) ;
224- formState . setField (
225- "participantMastodonHandle" ,
226- grant . participant . mastodonHandle ,
227- ) ;
228- }
229211 formState . setField ( "acceptedPrivacyPolicy" , true ) ;
230212 }
231- } , [ grant ] ) ;
213+
214+ if ( participantData . me . participant ) {
215+ formState . setField ( "participantBio" , participantData . me . participant . bio ) ;
216+ formState . setField (
217+ "participantWebsite" ,
218+ participantData . me . participant . website ,
219+ ) ;
220+ formState . setField (
221+ "participantTwitterHandle" ,
222+ participantData . me . participant . twitterHandle ,
223+ ) ;
224+ formState . setField (
225+ "participantInstagramHandle" ,
226+ participantData . me . participant . instagramHandle ,
227+ ) ;
228+ formState . setField (
229+ "participantLinkedinUrl" ,
230+ participantData . me . participant . linkedinUrl ,
231+ ) ;
232+ formState . setField (
233+ "participantFacebookUrl" ,
234+ participantData . me . participant . facebookUrl ,
235+ ) ;
236+ formState . setField (
237+ "participantMastodonHandle" ,
238+ participantData . me . participant . mastodonHandle ,
239+ ) ;
240+ }
241+ } , [ ] ) ;
232242
233243 const handleOnSubmit = useCallback (
234244 async ( e : React . FormEvent < HTMLFormElement > ) => {
@@ -656,6 +666,7 @@ export const GrantForm = ({
656666 < Spacer size = "medium" />
657667
658668 < PublicProfileCard
669+ me = { participantData . me }
659670 formOptions = { formOptions }
660671 photoRequired = { false }
661672 getParticipantValidationError = { ( field ) =>
0 commit comments