Skip to content

Conversation

Legend-Master
Copy link
Contributor

@Legend-Master Legend-Master commented Apr 26, 2025

Reference: #13307 (comment)

The approach is similar to what we did for the store plugin in tauri-apps/plugins-workspace#1860

@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Apr 26, 2025
Copy link
Contributor

github-actions bot commented Apr 26, 2025

Package Changes Through 9daa8cd

There 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 Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.5.0 2.6.0
tauri-bundler 2.4.0 2.4.1
tauri-runtime-wry 2.6.0 2.6.1
tauri 2.5.1 2.6.0
@tauri-apps/cli 2.5.0 2.5.1
tauri-cli 2.5.0 2.5.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master Legend-Master marked this pull request as ready for review April 27, 2025 05:41
@Legend-Master Legend-Master requested a review from a team as a code owner April 27, 2025 05:41
Copy link
Member

@lucasfernog lucasfernog left a 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?

@lucasfernog lucasfernog merged commit 4221124 into tauri-apps:dev May 6, 2025
23 checks passed
@github-project-automation github-project-automation bot moved this from 📬Proposal to 🔎 In audit in Roadmap May 6, 2025
@Legend-Master
Copy link
Contributor Author

Legend-Master commented May 6, 2025

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

@Legend-Master Legend-Master deleted the tray-icon-app-resource-table branch May 6, 2025 11:46
@merlinaudio
Copy link

merlinaudio commented Jul 5, 2025

@Legend-Master

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔎 In audit
Development

Successfully merging this pull request may close these issues.

3 participants