Prevent the insights dialog from showing duplicate buttons (#2122)

This commit is contained in:
Karl Burtram
2018-08-02 13:58:05 -04:00
committed by GitHub
parent 0d043207b9
commit 1a7f0673ea
2 changed files with 18 additions and 2 deletions

View File

@@ -295,8 +295,9 @@ export class InsightsDialogView extends Modal {
for (let action of this._insight.actions.types) {
let task = tasks.includes(action);
let commandAction = MenuRegistry.getCommand(action);
if (task) {
let button = this.addFooterButton(types.isString(commandAction.title) ? commandAction.title : commandAction.title.value, () => {
let commandLabel = types.isString(commandAction.title) ? commandAction.title : commandAction.title.value;
if (task && !this.findFooterButton(commandLabel)) {
let button = this.addFooterButton(commandLabel, () => {
let element = this._topTable.getSelectedRows();
let resource: ListResource;
if (element && element.length > 0) {