Closure for if feature has already been voted
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 }
Can you make an example PR that we can work on from?
Created an example PR
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