Skip to content

Commit

Permalink
Dev UI: Small cosmetic fix for dynamic menus
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Kruger <phillip.kruger@gmail.com>
  • Loading branch information
phillip-kruger committed Oct 15, 2024
1 parent 7f58037 commit acf4f18
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class QwcMenu extends observeState(LitElement) {

let items = [{ text: 'Remove', action: 'remove', id: page.id , namespace: page.namespace}];
return html`<vaadin-context-menu .items=${items} @item-selected=${this._handleContextMenu} title="${extensionName}">
${this._renderItem(page, index)}
${this._renderItem(page, -1)}
</vaadin-context-menu>`;
}
}
Expand Down Expand Up @@ -295,7 +295,11 @@ export class QwcMenu extends observeState(LitElement) {
hasMenuItem = true;
}
}

if(!hasMenuItem){
// Check the dynamic pages
hasMenuItem = this._dynamicMenuNamespaces.some(item => item.namespace === this._selectedPage);
}

if(!hasMenuItem && index === 0){
return "item selected";
}
Expand Down

0 comments on commit acf4f18

Please sign in to comment.