Redirect user to projects.index from projects.donate, if donation already exist - #803
Conversation
|
|
||
| afterModel({ project, subscription }) { | ||
| if (subscription) { | ||
| get(this, 'flashMessages').success('We are grateful for eagerness, but you are supporting us already.'); |
There was a problem hiding this comment.
We should buff this language:
You're already supporting this project.
|
@begedin I think flash messages aren't showing maybe because we clear them at the router transition level. I'm not sure if we are doing that, but it seems non-obvious means that it was a fix for something that went undocumented and is now not working as we would expect. Too hacky. |
7196dbf to
fe8ad69
Compare
|
@joshsmith We actually do clear messages on transition, which means two things.
My guess is, we are clearing messages because of most of the flashes we actually display are "sticky", meaning they never go away until the user dismisses them via click. Since all of these cases where there is a sticky also specify a timeout, my guess would be, we were adding them incorrectly to begin with. My suggestion is, we
|
5282c60 to
0492c4a
Compare
0492c4a to
3935cc5
Compare
|
@joshsmith I rewrote the flash messages and added some convenience test helpers for them, so we don't have to stub the service anymore. From now on, every time we display a message, we explicitly clear the message queue first. It didn't look like we need to not clear it in any place, but it's easily switchable now. |
alexgraffeocohen
left a comment
There was a problem hiding this comment.
Just before you merge, you might as well fix this Mirage model as well, something @joshsmith discovered.
|
@alexwilkinson addressed that change. |
…ady exists Rework flash messages do they don't clear on route transition Write test helpers for flash messages, to avoid stubbing the service
af4e85c to
c22a6dd
Compare

What's in this PR?
Changes the flow on the donate page to redirect to main project route if donation already exists.
Since it reuses the same logic as the
project.indexroute to find the user's subscription for the current project, I moved that logic into a service.I also added a flash message, but it doesn't seem to work for some reason. Flash messages do not seem to be broken, but I couldn't find a problem. Any pointers are welcome.
References
Fixes #798