Skip to content
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

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Conversation

myieye
Copy link
Contributor

@myieye myieye commented Oct 27, 2023

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.

@github-actions
Copy link

github-actions bot commented Oct 27, 2023

UI unit Tests

1 tests  ±0   1 ✔️ ±0   0s ⏱️ ±0s
1 suites ±0   0 💤 ±0 
1 files   ±0   0 ±0 

Results for commit 6a9450d. ± Comparison against base commit 638d0e7.

♻️ This comment has been updated with latest results.

@@ -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 });
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@myieye myieye force-pushed the stabilise-email-result-handling branch from c80a629 to c32d988 Compare October 31, 2023 11:04
@myieye myieye force-pushed the stabilise-email-result-handling branch from c32d988 to 6a9450d Compare October 31, 2023 11:07
@myieye
Copy link
Contributor Author

myieye commented Oct 31, 2023

I also greatly simplified closing the banner/notification.

@myieye myieye merged commit 570c61a into develop Oct 31, 2023
6 checks passed
@myieye myieye deleted the stabilise-email-result-handling branch October 31, 2023 12:14
@myieye
Copy link
Contributor Author

myieye commented Oct 31, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants