Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2740 from rlr/gh2705/rm-highlights
Browse files Browse the repository at this point in the history
fix (addon+content): #2705 remove highlights
  • Loading branch information
rlr committed Jun 21, 2017
2 parents 8e48395 + 918209f commit fb90a4f
Show file tree
Hide file tree
Showing 31 changed files with 30 additions and 1,807 deletions.
166 changes: 0 additions & 166 deletions addon/Feeds/HighlightsFeed.js

This file was deleted.

10 changes: 4 additions & 6 deletions addon/Feeds/MetadataFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const {Cu} = require("chrome");
const {PlacesProvider} = require("addon/PlacesProvider");
const Feed = require("addon/lib/Feed");
const am = require("common/action-manager");
const {VISITAGAIN_LENGTH} = require("common/constants");
const MAX_NUM_LINKS = 5;
const UPDATE_TIME = 24 * 60 * 60 * 1000; // Update once per day

Expand Down Expand Up @@ -44,13 +45,10 @@ module.exports = class MetadataFeed extends Feed {
links.forEach(link => this.urlsToFetch.push(link.url));
this.refresh(reason);
})
// Finally, get initial highlights metadata. This should be done last because
// it takes the longest, processing 100+ urls.
.then(() => PlacesProvider.links.getRecentlyVisited())
// Finally, get initial visit again metadata.
.then(() => PlacesProvider.links.getRecentlyVisited({limit: VISITAGAIN_LENGTH}))
.then(links => {
// We need to cap this otherwise on some average profile we'll attempt to
// fetch hundreds of links and hog the mainthread for a long time
links.slice(0, 50).forEach(link => this.urlsToFetch.push(link.url));
links.forEach(link => this.urlsToFetch.push(link.url));
this.refresh(reason);
});
}
Expand Down
2 changes: 0 additions & 2 deletions addon/Feeds/feeds.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const TopSitesFeed = require("./TopSitesFeed");
const PocketStoriesFeed = require("./PocketStoriesFeed");
const PocketTopicsFeed = require("./PocketTopicsFeed");
const HighlightsFeed = require("./HighlightsFeed");
const PlacesStatsFeed = require("./PlacesStatsFeed");
const SearchFeed = require("./SearchFeed");
const MetadataFeed = require("./MetadataFeed");
Expand All @@ -12,7 +11,6 @@ const VisitAgainFeed = require("./VisitAgainFeed");

module.exports = [
TopSitesFeed,
HighlightsFeed,
SearchFeed,
PocketStoriesFeed,
PocketTopicsFeed,
Expand Down
6 changes: 0 additions & 6 deletions common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ module.exports = {
// Number of "Read More" topics to display at the bottom of Pocket recommendations
POCKET_TOPICS_LENGTH: 5,

// Number of large Highlight tiles in the new Highlights world, including
// all rows.
HIGHLIGHTS_LENGTH: 9,

// Number of items in the Bookmarks section. Request more than actually being displayed
// in case the user will remove some of them we still have 3 items to display.
BOOKMARKS_LENGTH: 6,
Expand Down Expand Up @@ -51,10 +47,8 @@ module.exports = {
NEWTAB_PREFS_ENCODING: {
"showSearch": 1 << 0,
"showTopSites": 1 << 1,
"showHighlights": 1 << 2,
"showMoreTopSites": 1 << 3,
"showPocket": 1 << 4,
"collapseHighlights": 1 << 5,
"collapseBookmarks": 1 << 6,
"showBookmarks": 1 << 7,
"showVisitAgain": 1 << 8,
Expand Down
Loading

0 comments on commit fb90a4f

Please sign in to comment.