wishkit / wishkit-ios

In-App Feature Requests. Made Easy.
https://wishkit.io
MIT License
122 stars 23 forks source link

Call property updates on MainThread after voting #43

Closed Eirias closed 5 months ago

Eirias commented 6 months ago

Hey Martin,

i recognized that Xcode shows a violett warning

Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.

on the approvedWishlist property in the WishModel after upvoting an open wish. Check the attached screenshots:

Console_Log Xcode_Warning

I found out that the voteActionCompletion() needs to be put into DispatchQueue.main.async as well to avoid this error.

Feel free to merge my PR or even find a better solution to fix the issue. Thanks for your awesome repository and keep on the great work. Looking forward to see you on twitch again.

Best regards, Sebastian

Eirias commented 5 months ago

Hey @martinlasek, thanks for approving. I can't merge the branch, it says:

Only those with write access to this repository can merge pull requests.

Are you merging it or what do i have to do?

martinlasek commented 5 months ago

Merged! Thank you Eirias!