Skip to content

London | 25-SDC-Nov | Aida Eslamimoghadam | Sprint 1 | Fix hashtag slowing down my browser#174

Open
aydaeslami wants to merge 1 commit intoCodeYourFuture:mainfrom
aydaeslami:Hashtag-slowing-down
Open

London | 25-SDC-Nov | Aida Eslamimoghadam | Sprint 1 | Fix hashtag slowing down my browser#174
aydaeslami wants to merge 1 commit intoCodeYourFuture:mainfrom
aydaeslami:Hashtag-slowing-down

Conversation

@aydaeslami
Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Prevents blank flash when clicking hashtags by parsing content off-DOM before rendering.

@aydaeslami aydaeslami added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 1 Assigned during Sprint 1 of this module labels Mar 1, 2026
apiService.getBloomsByHashtag(hashtag);

if (state.currentHashtag !== hashtag) { // fetches only when the hashtag changes
state.updateState({ currentHashtag: hashtag });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

getBloomsByHashtag already updates state itself, so I wouldn't also update it here.

There's a risk that otherwise, if someone calls render after this updateState runs but before the blooms are fetched, then we'll end up showing the new hashtag as a title but the old blooms in the feed, which would be incorrect/confusing.

Copy link
Copy Markdown
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This looks good, and fixes the problem - just one suggestion to consider :)

@illicitonion illicitonion added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels May 5, 2026
@illicitonion illicitonion changed the title London | 25-SDC-Nov | Aida Eslamimoghadam | Sprint 1 | Fix blank flash on hashtag click London | 25-SDC-Nov | Aida Eslamimoghadam | Sprint 1 | Fix hashtag slowing down my browser May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants