Skip to content

Commit

Permalink
7011 (#7018)
Browse files Browse the repository at this point in the history
Co-authored-by: Soroush <sorgh@microsoft.com>
Co-authored-by: Srinaath Ravichandran <srinaath27@gmail.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
  • Loading branch information
4 people authored Apr 16, 2021
1 parent ab63ce7 commit 3735dd3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ export const navigationDispatcher = () => {
const designPageLocation = await snapshot.getPromise(designPageLocationState(skillId ?? projectId));
const { dialogId, selected } = designPageLocation;

const dialogs = await snapshot.getPromise(dialogsSelectorFamily(projectId));
const currentDialog = dialogs.find(({ id }) => id === dialogId);

const encodedSelectPath = encodeArrayPathToDesignerPath(currentDialog?.content, selected);

let currentUri =
skillId == null || skillId === projectId
? `/bot/${projectId}/dialogs/${dialogId}`
Expand All @@ -146,7 +151,7 @@ export const navigationDispatcher = () => {

currentUri = `${currentUri}?selected=${targetSelected}&focused=${encodedFocusPath}`;
} else {
currentUri = `${currentUri}?selected=${selected}`;
currentUri = `${currentUri}?selected=${encodedSelectPath}`;
}

if (fragment && typeof fragment === 'string') {
Expand All @@ -156,7 +161,7 @@ export const navigationDispatcher = () => {

set(designPageLocationState(skillId || projectId), {
dialogId,
selected: getSelected(focusPath) || selected,
selected: getSelected(focusPath) || encodedSelectPath,
focused: focusPath ?? '',
promptTab: Object.values(PromptTab).find((value) => fragment === value),
});
Expand Down

0 comments on commit 3735dd3

Please sign in to comment.