Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Revert to reopening a resource #5475

Merged
merged 8 commits into from
Jan 13, 2021
13 changes: 1 addition & 12 deletions Composer/packages/client/src/recoilModel/dispatchers/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
createQnAOnState,
currentProjectIdState,
filePersistenceState,
locationState,
projectMetaDataState,
settingsState,
showCreateQnAFromUrlDialogState,
Expand Down Expand Up @@ -209,19 +208,9 @@ export const projectDispatcher = () => {
navigate = true,
callback?: (projectId: string) => void
) => {
const { set, snapshot } = callbackHelpers;
const { set } = callbackHelpers;
try {
set(botOpeningState, true);
const rootBotId = await snapshot.getPromise(rootBotProjectIdSelector);

if (rootBotId) {
const rootBotLocation = await snapshot.getPromise(locationState(rootBotId));
// Reloading the same bot. No need to fetch resources again.
if (rootBotLocation === path) {
navigateToBot(callbackHelpers, rootBotId);
return;
}
}

await flushExistingTasks(callbackHelpers);
const { projectId, mainDialog } = await openRootBotAndSkillsByPath(callbackHelpers, path, storageId);
Expand Down