-
Notifications
You must be signed in to change notification settings - Fork 112
fix(systemaddon): Limit the number of topsites being rendered. #3081
Conversation
Any reason not to do this from the reducer? I also see there is basically the same |
@Mardak agreed. I initially tried to do this in the reducer and import the 12 constant from TopSitesFeed but that results in a circular dependency. So I decided it made more sense (if I have to duplicate the constant) to do it in the component. Should I create a constants file for this? |
@k88hudson any suggestions on this? If we just put the 12 Perhaps a step back, the reason why the extra pinned sites appear is that there's a |
The only disadvantage to handling In terms of sharing a constant, why not just define it in |
After some chatting with @rlr on irc. It sounds like async getFrecent(force) {
if (force || 15 minutes passed) {
this._frecent = await NewTabUtils.activityStreamLinks.getTopSites()
}
return this._frecent;
}
async getLinksWithDefaults(force) {
let frecent = await this.getFrecent(force);
} |
I suppose frequent |
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.
Move the const
from TopSitesFeed
to export from Reducers
and use that value to slice from both TopSitesFeed
and Reducers
c186a0a
to
5f5be92
Compare
@Mardak updated. |
Closes #2945.
Cause of bug seems more of an edge case: if you switch from AS to Tiles you could get different sites presented to you and pin > 12 sites. I managed to get 14 pinned sites on my profile. These show up on
PINNED_SITES_UPDATED
actions because the reducer does notslice
the results.I moved the slice in the actual component this way we could catch the issue if it happens from other sources as well.
It should not be a problem for people coming over from Tiles because they only had at most 12 tiles.