Skip to content

Commit

Permalink
websocket: fix duplicated New Context menu item
Browse files Browse the repository at this point in the history
Override the "new" method that makes use of weights to return the
proper menu item implementation, which corrects both the location it
appears in and its functionality.
Remove the "old" method as it's no longer used/needed.

Signed-off-by: thc202 <thc202@gmail.com>
  • Loading branch information
thc202 committed Dec 15, 2024
1 parent 0e2491b commit 658c9c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions addOns/websocket/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Update minimum ZAP version to 2.16.0.

### Fixed
- Correct location/function of New Context context menu item.

## [31] - 2024-05-07
### Added
- Support for menu weights (Issue 8369)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public boolean isEnableForComponent(Component invoker) {
}

@Override
protected ExtensionPopupMenuItem createPopupIncludeInContextMenu() {
return new PopupIncludeWebSocketInContextMenu();
protected ExtensionPopupMenuItem createPopupIncludeInContextMenu(int weight) {
PopupIncludeWebSocketInContextMenu menu = new PopupIncludeWebSocketInContextMenu();
menu.setWeight(weight);
return menu;
}

@Override
Expand Down

0 comments on commit 658c9c3

Please sign in to comment.