mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 09:35:39 -05:00
Fix a few more floating promises (#8290)
* Fix a few more floating promises * More explicit calls
This commit is contained in:
@@ -15,6 +15,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
||||
import { Button, IButtonStyles } from 'sql/base/browser/ui/button/button';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
export interface IDropdownStyles {
|
||||
backgroundColor?: Color;
|
||||
@@ -42,14 +43,14 @@ export class DropdownList extends Dropdown {
|
||||
this.button = new Button(_contentContainer);
|
||||
this.button.label = action.label;
|
||||
this._register(DOM.addDisposableListener(this.button.element, DOM.EventType.CLICK, () => {
|
||||
action.run();
|
||||
action.run().catch(e => onUnexpectedError(e));
|
||||
this.hide();
|
||||
}));
|
||||
this._register(DOM.addDisposableListener(this.button.element, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
if (event.equals(KeyCode.Enter)) {
|
||||
e.stopPropagation();
|
||||
action.run();
|
||||
action.run().catch(e => onUnexpectedError(e));
|
||||
this.hide();
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
import * as lifecycle from 'vs/base/common/lifecycle';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
|
||||
const defaultOptions: IActionBarOptions = {
|
||||
orientation: ActionsOrientation.HORIZONTAL,
|
||||
@@ -344,7 +345,7 @@ export class ActionBar extends ActionRunner implements IActionRunner {
|
||||
let actionItem = this._items[this._focusedItem];
|
||||
if (actionItem instanceof BaseActionViewItem) {
|
||||
const context = (actionItem._context === null || actionItem._context === undefined) ? event : actionItem._context;
|
||||
this.run(actionItem._action, context);
|
||||
this.run(actionItem._action, context).catch(e => onUnexpectedError(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user