diff --git a/Composer/packages/client/src/components/ProjectTree/ProjectTree.tsx b/Composer/packages/client/src/components/ProjectTree/ProjectTree.tsx index 185fb55af7..7c19757d0c 100644 --- a/Composer/packages/client/src/components/ProjectTree/ProjectTree.tsx +++ b/Composer/packages/client/src/components/ProjectTree/ProjectTree.tsx @@ -240,7 +240,7 @@ export const ProjectTree: React.FC = ({ useEffect(() => { setSelectedLink(defaultSelected); - }, [defaultSelected]); + }, [defaultSelected?.projectId, defaultSelected?.skillId, defaultSelected?.dialogId, defaultSelected?.trigger]); const rootProjectId = useRecoilValue(rootBotProjectIdSelector); const botProjectSpace = useRecoilValue(botProjectSpaceSelector); diff --git a/Composer/packages/client/src/pages/design/DesignPage.tsx b/Composer/packages/client/src/pages/design/DesignPage.tsx index 6ba2579986..c143fd3f2d 100644 --- a/Composer/packages/client/src/pages/design/DesignPage.tsx +++ b/Composer/packages/client/src/pages/design/DesignPage.tsx @@ -191,13 +191,13 @@ const DesignPage: React.FC(undefined); const [brokenSkillRepairCallback, setBrokenSkillRepairCallback] = useState void)>(undefined); const [dialogJsonVisible, setDialogJsonVisibility] = useState(false); - const [currentDialog, setCurrentDialog] = useState(dialogs[0] as DialogInfo); const [warningIsVisible, setWarningIsVisible] = useState(true); const [breadcrumbs, setBreadcrumbs] = useState>([]); const shell = useShell('DesignPage', skillId ?? rootProjectId); const shellForFlowEditor = useShell('FlowEditor', skillId ?? rootProjectId); const shellForPropertyEditor = useShell('PropertyEditor', skillId ?? rootProjectId); + const currentDialog = (dialogs.find(({ id }) => id === dialogId) ?? dialogs[0]) as DialogInfo; const { setPageElementState } = useRecoilValue(dispatcherState); @@ -210,11 +210,9 @@ const DesignPage: React.FC { - const currentDialog = dialogs.find(({ id }) => id === dialogId) as DialogInfo | undefined; - if (currentDialog) { - setCurrentDialog(currentDialog); + if (!warningIsVisible) { + setWarningIsVisible(true); } - setWarningIsVisible(true); }, [dialogId, dialogs, location]); // migration: add id to dialog when dialog doesn't have id diff --git a/Composer/packages/client/src/shell/lgApi.ts b/Composer/packages/client/src/shell/lgApi.ts index 0d0be9acb3..5013c87caf 100644 --- a/Composer/packages/client/src/shell/lgApi.ts +++ b/Composer/packages/client/src/shell/lgApi.ts @@ -99,7 +99,7 @@ function createLgApi( addLgTemplate: updateLgTemplate, getLgTemplates, updateLgTemplate, - debouncedUpdateLgTemplate: debounce(updateLgTemplate, 250, { leading: true, trailing: true }), + debouncedUpdateLgTemplate: debounce(updateLgTemplate, 250), removeLgTemplate, removeLgTemplates, copyLgTemplate, diff --git a/Composer/packages/client/src/shell/luApi.ts b/Composer/packages/client/src/shell/luApi.ts index ae4d185481..e94a6178c4 100644 --- a/Composer/packages/client/src/shell/luApi.ts +++ b/Composer/packages/client/src/shell/luApi.ts @@ -85,7 +85,7 @@ function createLuApi( getLuIntents, getLuIntent, updateLuIntent, - debouncedUpdateLuIntent: debounce(updateLuIntent, 250, { leading: true, trailing: true }), + debouncedUpdateLuIntent: debounce(updateLuIntent, 250), renameLuIntent, removeLuIntent, };