diff --git a/apps/portal/src/app/features/profile/components/AddressFormContent.tsx b/apps/portal/src/app/features/profile/components/AddressFormContent.tsx
index 617a34751..98e91081e 100644
--- a/apps/portal/src/app/features/profile/components/AddressFormContent.tsx
+++ b/apps/portal/src/app/features/profile/components/AddressFormContent.tsx
@@ -124,8 +124,9 @@ export function AddressFormContent({
/>
@@ -138,7 +139,8 @@ export function AddressFormContent({
diff --git a/apps/portal/src/app/features/profile/pages/ProfilePage.tsx b/apps/portal/src/app/features/profile/pages/ProfilePage.tsx
index 50e5c3550..1715affd1 100644
--- a/apps/portal/src/app/features/profile/pages/ProfilePage.tsx
+++ b/apps/portal/src/app/features/profile/pages/ProfilePage.tsx
@@ -195,36 +195,37 @@ export function ProfilePage() {
maritalStatus: currentProfile.maritalStatus || '',
});
- if (currentProfile.address) {
- setLoadedAddress({
- idType: currentProfile.address.idType || '',
- idNumber: currentProfile.address.idNumber || '',
- nationality: currentProfile.address.nationality || '',
- primaryPhoneNumber: currentProfile.address.primaryPhoneNumber || '',
- secondaryPhoneNumber: currentProfile.address.secondaryPhoneNumber || '',
- email: currentProfile.address.email || '',
- website: currentProfile.address.website || '',
- regionId: currentProfile.address.regionId || '',
- cityId: currentProfile.address.cityId || '',
- subcityId: currentProfile.address.subCityId || '',
- woredaId: currentProfile.address.woredaId || '',
- streetAddress: currentProfile.address.streetAddress || '',
- postalAddress: currentProfile.address.postalAddress || '',
- emergencyContactName: currentProfile.address.emergencyContactName || '',
- emergencyContactPhone: currentProfile.address.emergencyContactPhone || '',
- // Previously read `emergencycontactRelation` (lower-case c), so the
- // saved relationship never appeared when reopening the profile.
- emergencyContactRelation:
- currentProfile.address.emergencyContactRelation || '',
- });
- }
+ // Primary phone and email are the account's contact details (same
+ // source as the Personal tab), not the address record — always
+ // populated even before an address exists, and locked in the form.
+ setLoadedAddress({
+ idType: currentProfile.address?.idType || '',
+ idNumber: currentProfile.address?.idNumber || '',
+ nationality: currentProfile.address?.nationality || '',
+ primaryPhoneNumber: user?.phoneNumber || '',
+ secondaryPhoneNumber: currentProfile.address?.secondaryPhoneNumber || '',
+ email: user?.email || '',
+ website: currentProfile.address?.website || '',
+ regionId: currentProfile.address?.regionId || '',
+ cityId: currentProfile.address?.cityId || '',
+ subcityId: currentProfile.address?.subCityId || '',
+ woredaId: currentProfile.address?.woredaId || '',
+ streetAddress: currentProfile.address?.streetAddress || '',
+ postalAddress: currentProfile.address?.postalAddress || '',
+ emergencyContactName: currentProfile.address?.emergencyContactName || '',
+ emergencyContactPhone: currentProfile.address?.emergencyContactPhone || '',
+ // Previously read `emergencycontactRelation` (lower-case c), so the
+ // saved relationship never appeared when reopening the profile.
+ emergencyContactRelation:
+ currentProfile.address?.emergencyContactRelation || '',
+ });
setDataLoading(false);
} else if (!profileResolving) {
// Resolver finished and there is still nothing — render the empty form
// rather than an indefinite spinner.
setDataLoading(false);
}
- }, [resolvedProfile, storedProfile, profileResolving]);
+ }, [resolvedProfile, storedProfile, profileResolving, user]);
// Load the latest user from the server on mount
useEffect(() => {