Skip to content

Commit

Permalink
Merge ca4db39 into 7c49920
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Wilaby committed Mar 11, 2019
2 parents 7c49920 + ca4db39 commit 9da7a01
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
8 changes: 2 additions & 6 deletions packages/app/main/src/commands/botCommands.ts
Expand Up @@ -33,6 +33,7 @@

import * as path from 'path';

import { dialog } from 'electron';
import { BotInfo, getBotDisplayName, SharedConstants } from '@bfemulator/app-shared';
import { BotConfigWithPath, CommandRegistryImpl, mergeEndpoints, uniqueId } from '@bfemulator/sdk-shared';
import { BotConfigurationBase } from 'botframework-config/lib';
Expand Down Expand Up @@ -132,12 +133,7 @@ export function registerCommands(commandRegistry: CommandRegistryImpl) {
try {
bot = await loadBotWithRetry(botPath, secret);
} catch (e) {
const errMessage = `Failed to open the bot with error: ${e.message}`;
await Electron.dialog.showMessageBox(mainWindow.browserWindow, {
type: 'error',
message: errMessage,
});
throw new Error(errMessage);
await dialog.showErrorBox('Failed to open the bot', e.message);
}
if (!bot) {
// user couldn't provide correct secret, abort
Expand Down
6 changes: 3 additions & 3 deletions packages/app/main/src/commands/electronCommands.ts
Expand Up @@ -35,15 +35,15 @@ import * as path from 'path';
import { SharedConstants } from '@bfemulator/app-shared';
import { CommandRegistryImpl } from '@bfemulator/sdk-shared';
import * as Electron from 'electron';
import { app, Menu, MessageBoxOptions } from 'electron';
import { app, dialog, Menu, MessageBoxOptions } from 'electron';
import * as fs from 'fs-extra';

import { AppMenuBuilder } from '../appMenuBuilder';
import { getStore } from '../botData/store';
import { mainWindow } from '../main';
import { ContextMenuService } from '../services/contextMenuService';
import { showOpenDialog, showSaveDialog } from '../utils';
import { TelemetryService } from '../telemetry';
import { showOpenDialog, showSaveDialog } from '../utils';

const { shell } = Electron;

Expand All @@ -62,7 +62,7 @@ export function registerCommands(commandRegistry: CommandRegistryImpl) {
...options,
};
const args = modal ? [mainWindow.browserWindow, options] : [options];
return Electron.dialog.showMessageBox.apply(Electron.dialog, args);
return dialog.showMessageBox.apply(dialog, args);
});

// ---------------------------------------------------------------------------
Expand Down
14 changes: 5 additions & 9 deletions packages/app/main/src/main.ts
Expand Up @@ -37,8 +37,7 @@ import * as url from 'url';
import { newNotification, Notification, PersistentSettings, Settings, SharedConstants } from '@bfemulator/app-shared';
import { Users } from '@bfemulator/emulator-core';
import { ProgressInfo } from 'builder-util-runtime';
import * as Electron from 'electron';
import { app, systemPreferences } from 'electron';
import { app, dialog, systemPreferences } from 'electron';
import { UpdateInfo } from 'electron-updater';
import { Store } from 'redux';

Expand All @@ -48,19 +47,19 @@ import { AppUpdater } from './appUpdater';
import { getStore } from './botData/store';
import * as commandLine from './commandLine';
import { CommandRegistry, registerAllCommands } from './commands';
import { Protocol } from './constants';
import { Emulator, emulator } from './emulator';
import './fetchProxy';
import { ngrokEmitter } from './ngrok';
import { Window } from './platform/window';
import { azureLoggedInUserChanged } from './settingsData/actions/azureAuthActions';
import { rememberBounds, rememberTheme } from './settingsData/actions/windowStateActions';
import { dispatch, getSettings, getStore as getSettingsStore } from './settingsData/store';
import { botListsAreDifferent, ensureStoragePath, saveSettings, writeFile, isMac } from './utils';
import { TelemetryService } from './telemetry';
import { botListsAreDifferent, ensureStoragePath, isMac, saveSettings, writeFile } from './utils';
import { openFileFromCommandLine } from './utils/openFileFromCommandLine';
import { sendNotificationToClient } from './utils/sendNotificationToClient';
import { WindowManager } from './windowManager';
import { Protocol } from './constants';
import { TelemetryService } from './telemetry';

export let mainWindow: Window;
export let windowManager: WindowManager;
Expand Down Expand Up @@ -341,10 +340,7 @@ const createMainWindow = async () => {
windowManager = new WindowManager();

AppMenuBuilder.initAppMenu().catch(err => {
Electron.dialog.showErrorBox(
'Bot Framework Emulator',
`An error occurred while initializing the application menu: ${err}`
);
dialog.showErrorBox('Bot Framework Emulator', `An error occurred while initializing the application menu: ${err}`);
});

const rememberCurrentBounds = () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/emulator/core/src/utils/oauthLinkEncoder.ts
Expand Up @@ -31,12 +31,13 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import * as crypto from 'crypto';

import { Attachment, AttachmentContentTypes, GenericActivity, OAuthCard } from '@bfemulator/sdk-shared';

import { BotEmulator } from '../botEmulator';
import uniqueId from './uniqueId';

import * as crypto from 'crypto';
import uniqueId from './uniqueId';

export default class OAuthLinkEncoder {
public static OAuthUrlProtocol: string = 'oauthlink:';
Expand Down

0 comments on commit 9da7a01

Please sign in to comment.