-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilise email-result handling #353
Conversation
@@ -16,9 +16,13 @@ export const load = (({ url }) => { | |||
const emailResult = url.searchParams.get('emailResult') as EmailResult | null; | |||
if (emailResult) { | |||
if (!EMAIL_RESULTS.includes(emailResult)) throw new Error(`Invalid emailResult: ${emailResult}.`); | |||
if (browser) void goto(`${url.pathname}`, { replaceState: true }); | |||
if (browser) { | |||
void goto(`${url.pathname}`, { replaceState: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure this isn't what's causing issues? this is just to remove the search param from the url to keep it pretty right? If that's the case maybe we should just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good idea 😆.
I just removed the troublesome, unnecessarily complicated, minor UX feature.
c80a629
to
c32d988
Compare
c32d988
to
6a9450d
Compare
I also greatly simplified closing the banner/notification. |
@hahn-kev feel free to review again, but it seemed pretty safe to merge and there are a lot of PRs open, so I just went for it. |
This load function is fragile. It was tricky setting it up and when I changed to CSR (for experimentation) it stopped working.
I think we're generally not supposed to use stores in load functions, but I also think it's fine if it's only client-side. So, I think this is a good change, but I'm putting it in a PR so it's more visible.