Skip to content
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

Fixes #586, #678: Traymenu workspace statuses are not updating #688

Closed
wants to merge 1 commit into from

Conversation

nmder
Copy link

@nmder nmder commented Nov 11, 2024

Hi there,

I moved the workspace Toggles in the menu inside a @Published property of the ObservableObject to allow information flow. Then, the Toggles are updated along with the tray text inside updateTrayText().

Thanks!!

@@ -19,4 +26,17 @@ func updateTrayText() {
($0.activeWorkspace == focus.workspace && sortedMonitors.count > 1 ? "*" : "") + $0.activeWorkspace.name
}
.joined(separator: " │ ")
TrayMenuModel.shared.workspaceStatus = Workspace.all.map { (workspace: Workspace) in
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I don't think that it's the right way in Swift UI. You're mixing UI (WorkspaceButton) into ViewModel/ObservableObject (TrayMenuModel)

Anyway, the bug should be fixed in main branch now d172dfd

@nikitabobko nikitabobko added the pr-rejected Pull Request is rejected label Nov 27, 2024
@nmder nmder deleted the traymenufix branch November 28, 2024 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-rejected Pull Request is rejected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants