Skip to content

Commit

Permalink
Move BaseAppWrapper definition out of the useRootProfile hook
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee committed Oct 29, 2024
1 parent 0675b8d commit 21ae097
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ export const useRootProfile = () => {
filter((id) => id !== undefined),
tap(() => setRootProfileState({ rootProfileLoading: true })),
switchMap((id) => profilesManager.resolveRootProfile({ solutionNavId: id })),
tap(({ getRenderAppWrapper }) => {
const BaseAppWrapper: Profile['getRenderAppWrapper'] = ({ children }) => <>{children}</>;

tap(({ getRenderAppWrapper }) =>
setRootProfileState({
rootProfileLoading: false,
AppWrapper: getRenderAppWrapper?.(BaseAppWrapper) ?? BaseAppWrapper,
});
})
})
)
)
.subscribe();

Expand All @@ -51,3 +49,5 @@ export const useRootProfile = () => {

return rootProfileState;
};

const BaseAppWrapper: Profile['getRenderAppWrapper'] = ({ children }) => <>{children}</>;

0 comments on commit 21ae097

Please sign in to comment.