-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: use app's resource table for storing tray icons #13316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use app's resource table for storing tray icons #13316
Conversation
Package Changes Through 9daa8cdThere are 6 changes which include tauri with minor, @tauri-apps/api with minor, tauri-bundler with patch, tauri-cli with patch, @tauri-apps/cli with patch, tauri-runtime-wry with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means now we can call TrayIcon.getById for a tray that was created via config / Rust right?
We always could, this command I think was created exactly for that The story was if I remembered correctly, I asked about this in an issue that it would be nice to be able to do that and amr then implemented it |
As far as I know, the command was also created so you don't accidentally create multiple trays with HMR for example Otherwise, if you just did this in Vite: function createTray() { return TrayIcon.new({ id: "foo" }) }
// main.ts
createTray(); Then you'd get many trays. So function createTray() {
const existingTray = await TrayIcon.getById("foo");
return existingTray ?? TrayIcon.new(...)
} Is the only way to make it work "properly" from JS for many dev scenarios Thank you for working on this fix!! |
Reference: #13307 (comment)
The approach is similar to what we did for the store plugin in tauri-apps/plugins-workspace#1860