Roadmap icon indicating copy to clipboard operation
Roadmap copied to clipboard

Closure for if feature has already been voted

Open JamesSedlacek opened this issue 2 years ago • 3 comments

I'd like the ability to show a toast message whenever a user taps on a feature they already voted for. I can handle showing the message, but I need the RoadmapFeatureViewModel to be able to take in a closure & execute it inside of this guard statement: func vote() { guard !feature.hasVoted else { print("already voted for this, can't vote again") return }

JamesSedlacek avatar Feb 21 '23 18:02 JamesSedlacek

Can you make an example PR that we can work on from?

jordibruin avatar Feb 21 '23 19:02 jordibruin

Created an example PR

JamesSedlacek avatar Feb 21 '23 23:02 JamesSedlacek

Also commented in the PR, but for completeness: I rather see us removing the vote than telling the user they already voted. Keep the user in control, and solve the scenario of restoring unexpected votes at the same time.

See this issue: https://github.com/AvdLee/Roadmap/issues/18

AvdLee avatar Feb 22 '23 11:02 AvdLee