jonogon / jonogon-mono

Take Action on Issues you care about
MIT License
36 stars 34 forks source link

Fix Unauthorized Redirect on New Petition Creation #80

Closed errhythm closed 1 month ago

errhythm commented 1 month ago

When creating a new petition, it shows the following toast: image

The previous condition was to check if the user is the petition owner, moderator or admin, but when a new petition is created, the petition owner is not assigned and that's why it shows the warning and redirect.

imas234 commented 1 month ago

I think I addressed this with adding some existing isLoading from the trpc calls in the useEffect.

Good catch. Please check tomorrow to see if my changes addresses this and comment here.

Also, question to @omranjamal - do we want this fork -> pr modality? I actually don't know how you're supposed to review forks. Clone the fork itself?

errhythm commented 1 month ago

@imas234 Your solution worked. The change is already live now so I checked it and it's working. I will close it. Thank you.