@@ -409,6 +409,24 @@ export function PersonDetail() {
409409 setClaims ( newClaims ) ;
410410 } , [ dbId , personId ] ) ;
411411
412+ // Refresh photo state after setting a new primary photo
413+ const refreshPhotoState = useCallback ( async ( ) => {
414+ if ( ! personId ) return ;
415+ const [ photoCheck , wikiPhotoCheck , ancestryPhotoCheck , wikiTreePhotoCheck , linkedInPhotoCheck ] = await Promise . all ( [
416+ api . hasPhoto ( personId ) . catch ( ( ) => ( { exists : false } ) ) ,
417+ api . hasWikiPhoto ( personId ) . catch ( ( ) => ( { exists : false } ) ) ,
418+ api . hasAncestryPhoto ( personId ) . catch ( ( ) => ( { exists : false } ) ) ,
419+ api . hasWikiTreePhoto ( personId ) . catch ( ( ) => ( { exists : false } ) ) ,
420+ api . hasLinkedInPhoto ( personId ) . catch ( ( ) => ( { exists : false } ) ) ,
421+ ] ) ;
422+ setHasPhoto ( photoCheck ?. exists ?? false ) ;
423+ setHasFsPhoto ( ( photoCheck as { exists : boolean ; fsExists ?: boolean } ) ?. fsExists ?? false ) ;
424+ setHasWikiPhoto ( wikiPhotoCheck ?. exists ?? false ) ;
425+ setHasAncestryPhoto ( ancestryPhotoCheck ?. exists ?? false ) ;
426+ setHasWikiTreePhoto ( wikiTreePhotoCheck ?. exists ?? false ) ;
427+ setHasLinkedInPhoto ( linkedInPhotoCheck ?. exists ?? false ) ;
428+ } , [ personId ] ) ;
429+
412430 const handleSavePersonField = useCallback ( async ( fieldName : string , value : string , originalValue : string | null ) => {
413431 if ( ! dbId || ! personId ) return ;
414432 await api . setPersonOverride ( dbId , personId , {
@@ -1032,6 +1050,7 @@ export function PersonDetail() {
10321050 onShowUploadDialog = { ( ) => setShowUploadDialog ( true ) }
10331051 onShowAncestryUploadDialog = { ( ) => setShowAncestryUploadDialog ( true ) }
10341052 onShowLinkInput = { ( platform ) => setLinkingPlatform ( platform ) }
1053+ onPhotoChanged = { refreshPhotoState }
10351054 syncLoading = { syncLoading }
10361055 scrapeLoading = { scrapeLoading }
10371056 fetchingPhotoFrom = { fetchingPhotoFrom }
0 commit comments