Skip to content

Commit

Permalink
Merge pull request #998 from brave/feat/process-smart-ntt
Browse files Browse the repository at this point in the history
feat(smartNTT): process assets in new campaign array
  • Loading branch information
tackley authored Oct 17, 2024
2 parents 1cf1bc1 + ccce547 commit 64514cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ntpUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const jsonSchemaVersion = 1
* @typedef {{ imageUrl: string }} Logo
* @typedef {{ logo?: Logo, imageUrl: string}} Wallpaper
* @typedef {{ logo: Logo, wallpapers: Wallpaper[]}} Campaign
* @typedef {Campaign & { campaigns?: Campaign[], topSites?: { iconUrl }[] }} NTPAssetSchema
* @typedef {Campaign & { campaigns?: Campaign[], campaigns2?: Campaign[], topSites?: { iconUrl }[] }} NTPAssetSchema
*/

const createPhotoJsonFile = (path, body) => {
Expand Down Expand Up @@ -58,6 +58,11 @@ const getImageFileNameListFrom = (photoJsonObj) => {
getImageFileNameListFromCampaign(campaign).forEach(s => fileList.add(s))
}
}
if (photoJsonObj.campaigns2) {
for (const campaign of photoJsonObj.campaigns2) {
getImageFileNameListFromCampaign(campaign).forEach(s => fileList.add(s))
}
}
if (photoJsonObj.topSites) {
photoJsonObj.topSites.forEach((topSiteObj) => {
fileList.add(topSiteObj.iconUrl)
Expand Down

0 comments on commit 64514cb

Please sign in to comment.