@@ -18,8 +18,9 @@ import { useGetPortalContainer } from '../../primitives/portal';
1818import { replaceInPages , shrinkTotal } from '../../utils/infinite-pages' ;
1919import { ORGANIZATION_PERMISSIONS } from '../../utils/permissions' ;
2020import { organizationProfileModal } from '../organization-profile/organization-profile.modal' ;
21+ import { profileModal } from '../profile/profile.modal' ;
2122import type { MosaicProfile } from '../profile-pages/use-mosaic-profile' ;
22- import { userProfileModalOptions } from '../profile-pages/use-mosaic-profile' ;
23+ import { profileModalOptions , userProfileModalOptions } from '../profile-pages/use-mosaic-profile' ;
2324import { ORGANIZATION_PAGE_PREFIX } from '../user-profile/user-profile.layout' ;
2425import { userProfileModal } from '../user-profile/user-profile.modal' ;
2526import type {
@@ -178,6 +179,7 @@ export function useSwitcherModel(
178179 const clerk = useClerk ( ) ;
179180 const router = useMosaicRouter ( ) ;
180181 const userProfile = useModal ( userProfileModal ) ;
182+ const combinedProfile = useModal ( profileModal ) ;
181183 const organizationProfile = useModal ( organizationProfileModal ) ;
182184 const { newProfiles } = useMosaicExperimental ( ) ;
183185 const { userProfileProps, organizationProfileProps, userProfileUrl, organizationProfileUrl } = profile ;
@@ -193,13 +195,14 @@ export function useSwitcherModel(
193195 } ) ;
194196
195197 const profileCombined = opensCombinedProfile ( menuMode , profile ) ;
196- const mosaicUserProfile = userProfileModalOptions ( { ...profile , combined : profileCombined } ) ;
197198
198199 const manageAccount = openOrNavigate ( {
199200 url : userProfileUrl ,
200201 openModal : ( ) =>
201202 newProfiles
202- ? userProfile . open ( mosaicUserProfile , getContainer ?.( ) )
203+ ? profileCombined
204+ ? combinedProfile . open ( profileModalOptions ( profile ) , getContainer ?.( ) )
205+ : userProfile . open ( userProfileModalOptions ( profile ) , getContainer ?.( ) )
203206 : clerk . openUserProfile ( {
204207 getContainer,
205208 customPages : bridgedCustomPages . userProfile ,
@@ -221,9 +224,9 @@ export function useSwitcherModel(
221224 apiKeysProps : organizationProfileProps ?. apiKeysProps ,
222225 } ) ;
223226 } else if ( profileCombined ) {
224- userProfile . open (
227+ combinedProfile . open (
225228 {
226- ...mosaicUserProfile ,
229+ ...profileModalOptions ( profile ) ,
227230 page : `${ ORGANIZATION_PAGE_PREFIX } ${ organizationProfileProps ?. pageOrder ?. [ 0 ] ?? 'general' } ` ,
228231 } ,
229232 getContainer ?.( ) ,
0 commit comments