Skip to content

Commit d566824

Browse files
committed
fix: update session tasks flow to have single root
1 parent 07cd8f7 commit d566824

File tree

3 files changed

+26
-31
lines changed

3 files changed

+26
-31
lines changed

packages/clerk-js/src/ui/components/SessionTasks/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function SessionTasksRoutes(): JSX.Element {
5151
const ctx = useSessionTasksContext();
5252

5353
return (
54-
<Flow.Root flow='tasks'>
54+
<Flow.Root flow='sessionTasks'>
5555
<Switch>
5656
<Route path={INTERNAL_SESSION_TASK_ROUTE_BY_KEY['choose-organization']}>
5757
<TaskChooseOrganizationContext.Provider

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,29 @@ const TaskChooseOrganizationInternal = () => {
3333
const identifier = user?.primaryEmailAddress?.emailAddress ?? user?.username;
3434

3535
return (
36-
<Flow.Root flow='taskChooseOrganization'>
36+
<Flow.Part part='taskChooseOrganization'>
3737
<Card.Root>
38-
<Flow.Part part={hasExistingResources ? 'chooseOrganization' : 'createOrganization'}>
39-
<Card.Content sx={t => ({ padding: `${t.space.$8} ${t.space.$none} ${t.space.$none}`, gap: t.space.$7 })}>
40-
{isLoading ? (
41-
<Flex
42-
direction={'row'}
43-
align={'center'}
44-
justify={'center'}
45-
sx={t => ({
46-
height: '100%',
47-
minHeight: t.sizes.$100,
48-
})}
49-
>
50-
<Spinner
51-
size={'lg'}
52-
colorScheme={'primary'}
53-
elementDescriptor={descriptors.spinner}
54-
/>
55-
</Flex>
56-
) : (
57-
<TaskChooseOrganizationFlows initialFlow={hasExistingResources ? 'choose' : 'create'} />
58-
)}
59-
</Card.Content>
60-
</Flow.Part>
38+
<Card.Content sx={t => ({ padding: `${t.space.$8} ${t.space.$none} ${t.space.$none}`, gap: t.space.$7 })}>
39+
{isLoading ? (
40+
<Flex
41+
direction={'row'}
42+
align={'center'}
43+
justify={'center'}
44+
sx={t => ({
45+
height: '100%',
46+
minHeight: t.sizes.$100,
47+
})}
48+
>
49+
<Spinner
50+
size={'lg'}
51+
colorScheme={'primary'}
52+
elementDescriptor={descriptors.spinner}
53+
/>
54+
</Flex>
55+
) : (
56+
<TaskChooseOrganizationFlows initialFlow={hasExistingResources ? 'choose' : 'create'} />
57+
)}
58+
</Card.Content>
6159

6260
<Card.Footer>
6361
<Card.Action
@@ -82,7 +80,7 @@ const TaskChooseOrganizationInternal = () => {
8280
</Card.Action>
8381
</Card.Footer>
8482
</Card.Root>
85-
</Flow.Root>
83+
</Flow.Part>
8684
);
8785
};
8886

packages/clerk-js/src/ui/elements/contexts/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ export type FlowMetadata = {
100100
| 'apiKeys'
101101
| 'oauthConsent'
102102
| 'subscriptionDetails'
103-
| 'subscriptionDetails'
104-
| 'tasks'
105-
| 'taskChooseOrganization';
103+
| 'sessionTasks';
106104
part?:
107105
| 'start'
108106
| 'emailCode'
@@ -124,8 +122,7 @@ export type FlowMetadata = {
124122
| 'popover'
125123
| 'complete'
126124
| 'accountSwitcher'
127-
| 'chooseOrganization'
128-
| 'createOrganization';
125+
| 'taskChooseOrganization';
129126
};
130127

131128
const [FlowMetadataCtx, useFlowMetadata] = createContextAndHook<FlowMetadata>('FlowMetadata');

0 commit comments

Comments
 (0)