@@ -50,34 +50,20 @@ export const navigationDispatcher = () => {
5050
5151 const navTo = useRecoilCallback (
5252 ( { snapshot, set } : CallbackInterface ) => async (
53- projectId : string ,
53+ skillId : string | null ,
5454 dialogId : string | null ,
5555 breadcrumb : BreadcrumbItem [ ] = [ ]
5656 ) => {
5757 const rootBotProjectId = await snapshot . getPromise ( rootBotProjectIdSelector ) ;
5858 if ( rootBotProjectId == null ) return ;
5959
60- const dialogs = await snapshot . getPromise ( dialogsSelectorFamily ( projectId ) ) ;
60+ const projectId = skillId ?? rootBotProjectId ;
61+
6162 const designPageLocation = await snapshot . getPromise ( designPageLocationState ( projectId ) ) ;
6263 const updatedBreadcrumb = cloneDeep ( breadcrumb ) ;
6364 set ( currentProjectIdState , projectId ) ;
6465
65- let path ;
66- if ( dialogId !== designPageLocation . dialogId ) {
67- if ( dialogId == null ) {
68- } else {
69- const currentDialog = dialogs . find ( ( { id } ) => id === dialogId ) ;
70- const beginDialogIndex = currentDialog ?. triggers . findIndex ( ( { type } ) => type === SDKKinds . OnBeginDialog ) ;
71-
72- if ( typeof beginDialogIndex !== 'undefined' && beginDialogIndex >= 0 ) {
73- path = createSelectedPath ( beginDialogIndex ) ;
74- path = encodeArrayPathToDesignerPath ( currentDialog ?. content , path ) ;
75- updatedBreadcrumb . push ( { dialogId, selected : '' , focused : '' } ) ;
76- }
77- }
78- }
79-
80- const currentUri = convertPathToUrl ( rootBotProjectId , projectId , dialogId , path ) ;
66+ const currentUri = convertPathToUrl ( rootBotProjectId , projectId , dialogId ) ;
8167 if ( checkUrl ( currentUri , rootBotProjectId , projectId , designPageLocation ) ) return ;
8268
8369 navigateTo ( currentUri , { state : { breadcrumb : updatedBreadcrumb } } ) ;
0 commit comments