Skip to content

fix: restore tray context menu on Figma 126.10+ - #35

Open
ubermanu wants to merge 1 commit into
IliyaBrook:masterfrom
ubermanu:fix/tray-context-menu
Open

ubermanu wants to merge 1 commit into
IliyaBrook:masterfrom
ubermanu:fix/tray-context-menu

Conversation

@ubermanu

Copy link
Copy Markdown

Figma 126.10 minifies the tray right-click handler with optional chaining:

this.electronTray.on("right-click",()=>{this.electronTray?.popUpContextMenu(bZe())})

The setContextMenu() patch regex only matched the old var V;(V=...)==null||V... form. So the 126.10.10 release shipped without it, and right-clicking the tray icon shows no menu.

  • Match both forms and insert setContextMenu() before the handler
  • Move the patch into patch_tray_context_menu so it can be tested
  • Add scripts/tests/tray-context-menu.test.js

Checked against the main.js from the 126.10.10 AppImage.

Figma 126.10 minifies the right-click handler with optional chaining,
so the setContextMenu() patch no longer matched and right-click on the
tray icon showed no menu. Match both forms and cover it with tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant