In the button, remove the part where you're directly setting the contextMenu boolean.
Button {
selectedMessage = message
} label: {
MessageItem(message: message)
}
.buttonStyle(.plain)
Then, add an onChange trigger in the same rank as your fullScreenCover.
.onChange(of: selectedMessage) { newValue in
contextMenu = newValue != nil
}
That way, it will always trigger after, rather than relying on the lines being synchronous.
Post
Replies
Boosts
Views
Activity
Maybe they're giving us some way to track keyword rankings and such built-in? Would be nice to not have to rely on third party services for that.