Bug 1402023 - Limit the 'Recent Activity' list in the Library to a maximum of 6 items. r?Gijs
MozReview-Commit-ID: AVHRKvAJjWe
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -527,17 +527,22 @@ const PanelUI = {
// Since the library is the first view shown, we don't want to add a blocker
// to the event, which would make PanelMultiView wait to show it.
let container = this.clearLibraryRecentHighlights();
if (!this.libraryRecentHighlightsEnabled) {
this._loadingRecentHighlights = false;
return;
}
- let highlights = await NewTabUtils.activityStreamLinks.getHighlights({ withFavicons: true });
+ let highlights = await NewTabUtils.activityStreamLinks.getHighlights({
+ // As per bug 1402023, hard-coded limit, until Activity Stream develops a
+ // richer list.
+ numItems: 6,
+ withFavicons: true
+ });
// If there's nothing to display, or the panel is already hidden, get out.
if (!highlights.length || viewNode.panelMultiView.getAttribute("panelopen") != "true") {
this._loadingRecentHighlights = false;
return;
}
container.hidden = container.previousSibling.hidden =
container.previousSibling.previousSibling.hidden = false;