@@ -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 > (
@@ -200,33 +206,37 @@ export const GrantForm = ({
200206 formState . setField ( "notes" , grant . notes ) ;
201207 formState . setField ( "travellingFrom" , grant . travellingFrom ) ;
202208
203- if ( grant . participant ) {
204- formState . setField ( "participantBio" , grant . participant . bio ) ;
205- formState . setField ( "participantWebsite" , grant . participant . website ) ;
206- formState . setField (
207- "participantTwitterHandle" ,
208- grant . participant . twitterHandle ,
209- ) ;
210- formState . setField (
211- "participantInstagramHandle" ,
212- grant . participant . instagramHandle ,
213- ) ;
214- formState . setField (
215- "participantLinkedinUrl" ,
216- grant . participant . linkedinUrl ,
217- ) ;
218- formState . setField (
219- "participantFacebookUrl" ,
220- grant . participant . facebookUrl ,
221- ) ;
222- formState . setField (
223- "participantMastodonHandle" ,
224- grant . participant . mastodonHandle ,
225- ) ;
226- }
227209 formState . setField ( "acceptedPrivacyPolicy" , true ) ;
228210 }
229- } , [ grant ] ) ;
211+
212+ if ( participantData . me . participant ) {
213+ formState . setField ( "participantBio" , participantData . me . participant . bio ) ;
214+ formState . setField (
215+ "participantWebsite" ,
216+ participantData . me . participant . website ,
217+ ) ;
218+ formState . setField (
219+ "participantTwitterHandle" ,
220+ participantData . me . participant . twitterHandle ,
221+ ) ;
222+ formState . setField (
223+ "participantInstagramHandle" ,
224+ participantData . me . participant . instagramHandle ,
225+ ) ;
226+ formState . setField (
227+ "participantLinkedinUrl" ,
228+ participantData . me . participant . linkedinUrl ,
229+ ) ;
230+ formState . setField (
231+ "participantFacebookUrl" ,
232+ participantData . me . participant . facebookUrl ,
233+ ) ;
234+ formState . setField (
235+ "participantMastodonHandle" ,
236+ participantData . me . participant . mastodonHandle ,
237+ ) ;
238+ }
239+ } , [ ] ) ;
230240
231241 const handleOnSubmit = useCallback (
232242 async ( e : React . FormEvent < HTMLFormElement > ) => {
@@ -666,6 +676,7 @@ export const GrantForm = ({
666676 < Spacer size = "medium" />
667677
668678 < PublicProfileCard
679+ me = { participantData . me }
669680 formOptions = { formOptions }
670681 photoRequired = { false }
671682 getParticipantValidationError = { ( field ) =>
0 commit comments