@@ -246,9 +246,16 @@ export const visibilitiesSelector = createSelector(
246
246
visibilityLanguageProficiencies : preferences . visibilityLanguageProficiencies || 'all_users' ,
247
247
visibilityName : preferences . visibilityName || 'all_users' ,
248
248
visibilitySocialLinks : preferences . visibilitySocialLinks || 'all_users' ,
249
- visibilityExtendedProfile : preferences . visibilityExtendedProfile || 'all_users' ,
249
+ visibilityExtendedProfile : preferences . visibilityExtendedProfile || { } ,
250
250
} ;
251
- case 'private' :
251
+ case 'private' : {
252
+ const visibilityExtendedProfile = { } ;
253
+
254
+ if ( preferences . visibilityExtendedProfile ) {
255
+ Object . keys ( preferences . visibilityExtendedProfile ) . forEach ( ( key ) => {
256
+ visibilityExtendedProfile [ key ] = 'private' ;
257
+ } ) ;
258
+ }
252
259
return {
253
260
visibilityBio : 'private' ,
254
261
visibilityCourseCertificates : 'private' ,
@@ -257,14 +264,22 @@ export const visibilitiesSelector = createSelector(
257
264
visibilityLanguageProficiencies : 'private' ,
258
265
visibilityName : 'private' ,
259
266
visibilitySocialLinks : 'private' ,
260
- visibilityExtendedProfile : 'private' ,
267
+ visibilityExtendedProfile,
261
268
} ;
269
+ }
262
270
case 'all_users' :
263
- default :
271
+ default : {
264
272
// All users is intended to fall through to default.
265
273
// If there is no value for accountPrivacy in perferences, that means it has not been
266
274
// explicitly set yet. The server assumes - today - that this means "all_users",
267
275
// so we emulate that here in the client.
276
+ const visibilityExtendedProfile = { } ;
277
+ if ( preferences . visibilityExtendedProfile ) {
278
+ Object . keys ( preferences . visibilityExtendedProfile ) . forEach ( ( key ) => {
279
+ visibilityExtendedProfile [ key ] = 'all_users' ;
280
+ } ) ;
281
+ }
282
+
268
283
return {
269
284
visibilityBio : 'all_users' ,
270
285
visibilityCourseCertificates : 'all_users' ,
@@ -273,8 +288,8 @@ export const visibilitiesSelector = createSelector(
273
288
visibilityLanguageProficiencies : 'all_users' ,
274
289
visibilityName : 'all_users' ,
275
290
visibilitySocialLinks : 'all_users' ,
276
- visibilityExtendedProfile : 'all_users' ,
277
- } ;
291
+ visibilityExtendedProfile,
292
+ } ; }
278
293
}
279
294
} ,
280
295
) ;
@@ -393,6 +408,7 @@ export const profilePageSelector = createSelector(
393
408
photoUploadError : errors . photo || null ,
394
409
395
410
// Extended profile fields
411
+ // Combine the field properties and its values
396
412
extendedProfileFields : extendedProfileFields . map ( ( field ) => ( {
397
413
...field ,
398
414
value : account . extendedProfile ?. find (
0 commit comments