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

Appeals - Remove appeals when switch account list #1196

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

dr-bizz
Copy link
Contributor

@dr-bizz dr-bizz commented Nov 15, 2024

Description

Ensure React keeps track of the appeals, to ensure they are removed correctly when the user switches account.

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels. (Add the label "On Staging" to get the branch automatically merged into staging.)
  • I have requested a review from another person on the project

@dr-bizz dr-bizz added the Preview Environment Add this label to create an Amplify Preview label Nov 15, 2024
@dr-bizz dr-bizz requested a review from caleballdrin November 15, 2024 19:41
Copy link
Contributor

Copy link
Contributor

Bundle sizes [mpdx-react]

Compared against 95a5eae

No significant changes found

Copy link
Contributor

@caleballdrin caleballdrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fixes the issue for me!

@dr-bizz
Copy link
Contributor Author

dr-bizz commented Nov 15, 2024

Great!

@dr-bizz dr-bizz merged commit 5f6646c into main Nov 15, 2024
19 checks passed
@dr-bizz dr-bizz deleted the fix-appeal-not-changing-on-account-switch branch November 15, 2024 19:56
</Box>
))}
</>
data.regularAppeals.nodes.map((appeal) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dr-bizz Do you know why moving it outside of the fragment changes things?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was the key. At first, it was the appeal's name, which sometimes had duplicates. I switched it to the id, which would be unique.

I don't think removing the fragment did anything apart from simplifying the code (in my opinion). Maybe React read the Fragment as an item and kept it in the render, but that is unlikely.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I missed that the key changed. That's probably what fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Environment Add this label to create an Amplify Preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants