Skip to content

feature: Add destroy menubar capability#323

Open
typologist wants to merge 8 commits into
max-mapper:masterfrom
typologist:add-destroy-feature
Open

feature: Add destroy menubar capability#323
typologist wants to merge 8 commits into
max-mapper:masterfrom
typologist:add-destroy-feature

Conversation

@typologist
Copy link
Copy Markdown

  • Adds a destroy() method which removes all event listeners and prevents the window from opening after that, until a new instance is created
  • Adds a isDestroyed() method to know the destroyed status of menubar
  • Updates the readme accordingly
  • Fixes this issue when destroying the menubar reference

@mulhoon
Copy link
Copy Markdown

mulhoon commented Jun 16, 2022

Hello 👋
Why wasn't this merged? is there any other way of destroying the menubar?

afonsojramos added a commit to gitify-app/menubar that referenced this pull request May 9, 2026
## Summary

- Adds a `destroy()` method that removes all tray and app listeners,
destroys the underlying `BrowserWindow`, and prevents the window from
opening again until a new `Menubar` instance is created.
- Adds an `isDestroyed()` accessor reporting the destroyed state.
- Refactors `clicked`, `onAppReady`, and `onAppActivate` into
arrow-function class fields so they have stable references and can be
removed from event emitters by reference.
- Documents the new methods in the README.
- Adds tests for `destroy()` / `isDestroyed()` and extends the electron
mock with `destroy` / `removeListener`.

Adapted from the upstream PR
[max-mapper#323](max-mapper#323)
by @typologist, which fixes
[max-mapper#281](max-mapper#281).

## Test plan

- [x] `bun run test` — all tests pass
- [x] `bun run typecheck` — no errors
- [x] `bun run lint:check` — no new warnings (one pre-existing warning
unrelated to this PR)
- [x] `bun run build` — produces ESM/CJS bundles

---------

Co-authored-by: Jimmy <3059814+typologist@users.noreply.github.com>
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.

Destroy Menubar

2 participants