Permalink
Browse files

#22810 - Cancelling out of the 'Open bot' dialog will no longer close…

… all non-global tabs (#469)

* Cancelling out of the 'Open bot' file dialog will no longer close out all tabs.

* Changed console messages in catch blocks to errors.
  • Loading branch information...
tonyanziano authored and eanders-MS committed May 4, 2018
1 parent 618416f commit adefdb7e269f62b9ab014b2fd13c5b2500c63e86
Showing with 15 additions and 13 deletions.
  1. +15 −13 packages/app/client/src/ui/helpers/activeBotHelper.ts
@@ -170,24 +170,26 @@ export const ActiveBotHelper = new class {
try {
const filename = await this.browseForBotFile()
let activeBot = getActiveBot();
if (activeBot && activeBot.path === filename) {
await this.botAlreadyOpen();
return;
}
if (filename) {
let activeBot = getActiveBot();
if (activeBot && activeBot.path === filename) {
await this.botAlreadyOpen();
return;
}
try {
const result = this.confirmSwitchBot();
try {
const result = this.confirmSwitchBot();
if (result) {
store.dispatch(EditorActions.closeNonGlobalTabs());
CommandService.remoteCall('bot:load', filename);
if (result) {
store.dispatch(EditorActions.closeNonGlobalTabs());
CommandService.remoteCall('bot:load', filename);
}
} catch (err) {
console.error('Error while calling confirmSwitchBot: ', err);
}
} catch (err) {
console.log('canceled confirmSwitchBot');
}
} catch (err) {
console.log('canceled browseForBotFile');
console.error('Error while calling browseForBotFile: ', err);
}
}

0 comments on commit adefdb7

Please sign in to comment.