From f6e99498d2bc5b3f07e1e2b6f668a1a48de35047 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 10 Mar 2020 21:54:49 +0100 Subject: [PATCH 1/8] handle cases where no claim object is present --- dist/bundle.es.js | 31 ++++++++++++--------- src/redux/selectors/claims.js | 51 +++++++++++++++++++++-------------- 2 files changed, 49 insertions(+), 33 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 39b13cd..7f367b7 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2406,28 +2406,33 @@ const makeSelectMyStreamUrlsForPage = (page = 1) => reselect.createSelector(sele const selectMyStreamUrlsCount = reselect.createSelector(selectMyClaimUrisWithoutChannels, channels => channels.length); -const makeSelectResolvedRecommendedContentForUri = (uri, size) => reselect.createSelector(makeSelectClaimForUri(uri), selectResolvedSearchResultsByQuery, makeSelectClaimIsNsfw(uri), (claim, resolvedResultsByQuery, isMature) => { +const makeSelectResolvedRecommendedContentForUri = (uri, size, claimId, claimName, claimTitle) => reselect.createSelector(makeSelectClaimForUri(uri), selectResolvedSearchResultsByQuery, makeSelectClaimIsNsfw(uri), (claim, resolvedResultsByQuery, isMature) => { const atVanityURI = !uri.includes('#'); + let currentUri; let recommendedContent; + let title; if (claim) { // always grab full URL - this can change once search returns canonical - const currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }); - + currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }); const { title } = claim.value; + } else { + // for cases on mobile where the claim may not have been resolved () + currentUri = buildURI({ streamClaimId: claimId, streamName: claimName }); + title = claimTitle; + } - if (!title) { - return; - } + if (!title) { + return; + } - const options = { related_to: claim.claim_id, size, isBackgroundSearch: false }; + const options = { related_to: claim ? claim.claim_id : claimId, size, isBackgroundSearch: false }; - const searchQuery = getSearchQueryString(title.replace(/\//, ' '), options); - let results = resolvedResultsByQuery[searchQuery]; - if (results) { - results = results.filter(result => buildURI({ streamClaimId: result.claimId, streamName: result.name }) !== currentUri); - recommendedContent = results; - } + const searchQuery = getSearchQueryString(claimTitle.replace(/\//, ' '), options); + let results = resolvedResultsByQuery[searchQuery]; + if (results) { + results = results.filter(result => buildURI({ streamClaimId: result.claimId, streamName: result.name }) !== currentUri); + recommendedContent = results; } return recommendedContent; diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index f359844..d9b893c 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -678,7 +678,13 @@ export const selectMyStreamUrlsCount = createSelector( channels => channels.length ); -export const makeSelectResolvedRecommendedContentForUri = (uri: string, size: number) => +export const makeSelectResolvedRecommendedContentForUri = ( + uri: string, + size: number, + claimId: string, + claimName: string, + claimTitle: string +) => createSelector( makeSelectClaimForUri(uri), selectResolvedSearchResultsByQuery, @@ -686,32 +692,37 @@ export const makeSelectResolvedRecommendedContentForUri = (uri: string, size: nu (claim, resolvedResultsByQuery, isMature) => { const atVanityURI = !uri.includes('#'); + let currentUri; let recommendedContent; + let title; if (claim) { // always grab full URL - this can change once search returns canonical - const currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }); - + currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }); const { title } = claim.value; + } else { + // for cases on mobile where the claim may not have been resolved () + currentUri = buildURI({ streamClaimId: claimId, streamName: claimName }); + title = claimTitle; + } - if (!title) { - return; - } + if (!title) { + return; + } - const options: { - related_to?: string, - nsfw?: boolean, - isBackgroundSearch?: boolean, - } = { related_to: claim.claim_id, size, isBackgroundSearch: false }; + const options: { + related_to?: string, + nsfw?: boolean, + isBackgroundSearch?: boolean, + } = { related_to: claim ? claim.claim_id : claimId, size, isBackgroundSearch: false }; - const searchQuery = getSearchQueryString(title.replace(/\//, ' '), options); - let results = resolvedResultsByQuery[searchQuery]; - if (results) { - results = results.filter( - result => - buildURI({ streamClaimId: result.claimId, streamName: result.name }) !== currentUri - ); - recommendedContent = results; - } + const searchQuery = getSearchQueryString(claimTitle.replace(/\//, ' '), options); + let results = resolvedResultsByQuery[searchQuery]; + if (results) { + results = results.filter( + result => + buildURI({ streamClaimId: result.claimId, streamName: result.name }) !== currentUri + ); + recommendedContent = results; } return recommendedContent; -- 2.45.3 From a097c14c31765658ee3206391b34e57868918944 Mon Sep 17 00:00:00 2001 From: Andrey Beletsky Date: Thu, 12 Mar 2020 15:28:47 +0700 Subject: [PATCH 2/8] Add method name to the API query string --- src/lbry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lbry.js b/src/lbry.js index ea72713..146149d 100644 --- a/src/lbry.js +++ b/src/lbry.js @@ -191,7 +191,7 @@ export function apiCall(method: string, params: ?{}, resolve: Function, reject: }), }; - return fetch(Lbry.daemonConnectionString, options) + return fetch(Lbry.daemonConnectionString + '?m=' + method, options) .then(checkAndParse) .then(response => { const error = response.error || (response.result && response.result.error); -- 2.45.3 From 8c106012394db1d6f6a78e992a06a037f081858e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 12 Mar 2020 11:25:33 -0400 Subject: [PATCH 3/8] update build --- dist/bundle.es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 39b13cd..1545e0d 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1052,7 +1052,7 @@ function apiCall(method, params, resolve, reject) { }) }; - return fetch(Lbry.daemonConnectionString, options).then(checkAndParse).then(response => { + return fetch(Lbry.daemonConnectionString + '?m=' + method, options).then(checkAndParse).then(response => { const error = response.error || response.result && response.result.error; if (error) { -- 2.45.3 From 37a01f56c1948b28fa60c38a7a289f6b53ef38b0 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Thu, 12 Mar 2020 12:21:48 -0400 Subject: [PATCH 4/8] light tag cleanup --- src/constants/tags.js | 41 +++++++++++------------------------------ 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/src/constants/tags.js b/src/constants/tags.js index 3a1e26d..291336d 100644 --- a/src/constants/tags.js +++ b/src/constants/tags.js @@ -20,11 +20,11 @@ export const DEFAULT_KNOWN_TAGS = [ 'censorship', 'gaming', 'pop culture', - 'Entertainment', + 'entertainment', 'technology', 'music', 'funny', - 'Education', + 'education', 'learning', 'news', 'gameplay', @@ -32,16 +32,13 @@ export const DEFAULT_KNOWN_TAGS = [ 'beliefs', 'comedy', 'games', - 'sony interactive entertainment', 'film & animation', 'game', 'weapons', - "let's play", 'blockchain', 'video game', 'sports', 'walkthrough', - 'ps4live', 'art', 'pc', 'minecraft', @@ -49,7 +46,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'economics', 'automotive', 'play', - 'ps4share', 'tutorial', 'twitch', 'how to', @@ -60,17 +56,16 @@ export const DEFAULT_KNOWN_TAGS = [ 'lets play', 'fun', 'politics', - 'xbox', - 'autos & vehicles', - 'Travel & Events', + 'travel', 'food', 'science', - 'xbox one', + 'xbox', 'liberal', 'democrat', 'progressive', 'survival', - 'Nonprofits & Activism', + 'non-profits', + 'activism', 'cryptocurrency', 'playstation', 'nintendo', @@ -125,7 +120,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'lol', 'sony', 'god', - "let's", 'dance', 'pvp', 'tech', @@ -133,12 +127,10 @@ export const DEFAULT_KNOWN_TAGS = [ 'zombies', 'fail', 'film', - 'xbox 360', + 'xbox360', 'animation', 'unboxing', 'money', - 'how', - 'travel', 'wwe', 'mods', 'indie', @@ -146,7 +138,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'ios', 'history', 'rap', - 'sony computer entertainment', 'mobile', 'trump', 'hack', @@ -170,7 +161,7 @@ export const DEFAULT_KNOWN_TAGS = [ 'mining', 'daily', 'diy', - 'pets & animals', + 'pets', 'videogame', 'death', 'funny moments', @@ -198,14 +189,12 @@ export const DEFAULT_KNOWN_TAGS = [ 'house', 'fire', 'bass', - 'bitcoin news', 'truth', 'crash', 'mario', 'league of legends', 'wii', 'mmorpg', - 'grand theft auto v', 'health', 'marvel', 'racing', @@ -239,7 +228,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'dota 2', 'studio', 'star wars', - 'gta 5', 'shooting', 'nasa', 'rock', @@ -272,7 +260,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'world of warcraft', 'industry', 'cartoon', - 'crypto news', 'garden', 'animals', 'windows', @@ -286,7 +273,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'parody', 'rv', 'beats', - 'fortnite battle royale', 'building', 'disney', 'drone', @@ -319,7 +305,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'canon', 'microsoft', 'camping', - 'cryptocurrency news', 'ufo', 'progressive talk', 'switch', @@ -355,7 +340,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'manga', 'howto', 'insane', - 'xbox360', 'press', 'special', 'church', @@ -372,7 +356,7 @@ export const DEFAULT_KNOWN_TAGS = [ 'sound', 'christ', 'duty', - 'Juvenile fiction', + 'juvenile fiction', 'pc game', 'how-to', 'ww2', @@ -411,7 +395,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'style', 'travel trailer', 'rda', - '5859dfec-026f-46ba-bea0-02bf43aa1a6f', 'gun', 'secret', 'far cry 5', @@ -452,8 +435,6 @@ export const DEFAULT_KNOWN_TAGS = [ 'capcom', 'rta', 'discord', - 'action role-playing game', - 'playthrough part', 'batman', 'player', 'server', @@ -494,7 +475,7 @@ export const DEFAULT_KNOWN_TAGS = [ 'paladins', 'warrior', 'creepypasta', - 'role-playing video game', + 'role-playing', 'solar', 'vr', 'animal', @@ -503,7 +484,7 @@ export const DEFAULT_KNOWN_TAGS = [ 'dota', 'audio', 'mass effect', - 'Humour', + 'humour', 'first look', 'videogames', 'future bass', -- 2.45.3 From c86309884241d0512b39232fb981a0036f5db92d Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 13 Mar 2020 17:26:31 +0100 Subject: [PATCH 5/8] fix variable --- src/redux/selectors/claims.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index d9b893c..f84fce3 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -715,7 +715,7 @@ export const makeSelectResolvedRecommendedContentForUri = ( isBackgroundSearch?: boolean, } = { related_to: claim ? claim.claim_id : claimId, size, isBackgroundSearch: false }; - const searchQuery = getSearchQueryString(claimTitle.replace(/\//, ' '), options); + const searchQuery = getSearchQueryString(title.replace(/\//, ' '), options); let results = resolvedResultsByQuery[searchQuery]; if (results) { results = results.filter( -- 2.45.3 From 91c60558c63c2b59a0ee2cbbf1ed69d10f649a25 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 13 Mar 2020 17:32:37 +0100 Subject: [PATCH 6/8] update bundle --- dist/bundle.es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 7f367b7..1c72cf9 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2428,7 +2428,7 @@ const makeSelectResolvedRecommendedContentForUri = (uri, size, claimId, claimNam const options = { related_to: claim ? claim.claim_id : claimId, size, isBackgroundSearch: false }; - const searchQuery = getSearchQueryString(claimTitle.replace(/\//, ' '), options); + const searchQuery = getSearchQueryString(title.replace(/\//, ' '), options); let results = resolvedResultsByQuery[searchQuery]; if (results) { results = results.filter(result => buildURI({ streamClaimId: result.claimId, streamName: result.name }) !== currentUri); -- 2.45.3 From 84e697079968364fe526020086c8a44f4d2ef391 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 13 Mar 2020 17:35:54 +0100 Subject: [PATCH 7/8] get the title properly --- dist/bundle.es.js | 2 +- src/redux/selectors/claims.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 1c72cf9..5602bc7 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2415,7 +2415,7 @@ const makeSelectResolvedRecommendedContentForUri = (uri, size, claimId, claimNam if (claim) { // always grab full URL - this can change once search returns canonical currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }); - const { title } = claim.value; + title = claim.value ? claim.value.title : null; } else { // for cases on mobile where the claim may not have been resolved () currentUri = buildURI({ streamClaimId: claimId, streamName: claimName }); diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index f84fce3..7b0c5dd 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -698,7 +698,7 @@ export const makeSelectResolvedRecommendedContentForUri = ( if (claim) { // always grab full URL - this can change once search returns canonical currentUri = buildURI({ streamClaimId: claim.claim_id, streamName: claim.name }); - const { title } = claim.value; + title = claim.value ? claim.value.title : null; } else { // for cases on mobile where the claim may not have been resolved () currentUri = buildURI({ streamClaimId: claimId, streamName: claimName }); -- 2.45.3 From 6ed0dde5cbd7c25aa02631d5fa31fb6a4de76876 Mon Sep 17 00:00:00 2001 From: jessop Date: Mon, 16 Mar 2020 16:29:52 -0400 Subject: [PATCH 8/8] no default tags --- dist/bundle.es.js | 13 ++++++++----- src/redux/reducers/tags.js | 10 ++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 1545e0d..dd4378a 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -870,7 +870,7 @@ const DEFAULT_FOLLOWED_TAGS = ['art', 'automotive', 'blockchain', 'comedy', 'eco const MATURE_TAGS = ['porn', 'nsfw', 'mature', 'xxx']; -const DEFAULT_KNOWN_TAGS = ['free speech', 'censorship', 'gaming', 'pop culture', 'Entertainment', 'technology', 'music', 'funny', 'Education', 'learning', 'news', 'gameplay', 'nature', 'beliefs', 'comedy', 'games', 'sony interactive entertainment', 'film & animation', 'game', 'weapons', "let's play", 'blockchain', 'video game', 'sports', 'walkthrough', 'ps4live', 'art', 'pc', 'minecraft', 'playthrough', 'economics', 'automotive', 'play', 'ps4share', 'tutorial', 'twitch', 'how to', 'ps4', 'bitcoin', 'fortnite', 'commentary', 'lets play', 'fun', 'politics', 'xbox', 'autos & vehicles', 'Travel & Events', 'food', 'science', 'xbox one', 'liberal', 'democrat', 'progressive', 'survival', 'Nonprofits & Activism', 'cryptocurrency', 'playstation', 'nintendo', 'government', 'steam', 'podcast', 'gamer', 'horror', 'conservative', 'reaction', 'trailer', 'love', 'cnn', 'republican', 'political', 'hangoutsonair', 'hoa', 'msnbc', 'cbs', 'anime', 'donald trump', 'fiction', 'fox news', 'crypto', 'ethereum', 'call of duty', 'android', 'multiplayer', 'epic', 'rpg', 'adventure', 'secular talk', 'btc', 'atheist', 'atheism', 'video games', 'ps3', 'cod', 'online', 'agnostic', 'movie', 'fps', 'lets', 'mod', 'world', 'reviews', 'sharefactory', 'space', 'pokemon', 'stream', 'hilarious', 'lol', 'sony', 'god', "let's", 'dance', 'pvp', 'tech', 'strategy', 'zombies', 'fail', 'film', 'xbox 360', 'animation', 'unboxing', 'money', 'how', 'travel', 'wwe', 'mods', 'indie', 'pubg', 'ios', 'history', 'rap', 'sony computer entertainment', 'mobile', 'trump', 'hack', 'flat earth', 'trap', 'humor', 'vlogging', 'fox', 'news radio', 'facebook', 'edm', 'fitness', 'vaping', 'hip hop', 'secular', 'jesus', 'song', 'vape', 'guitar', 'remix', 'mining', 'daily', 'diy', 'pets & animals', 'videogame', 'death', 'funny moments', 'religion', 'media', 'viral', 'war', 'nbc', 'freedom', 'gold', 'family', 'meme', 'zombie', 'photography', 'chill', 'sniper', 'computer', 'iphone', 'dragon', 'bible', 'pro', 'overwatch', 'litecoin', 'gta', 'house', 'fire', 'bass', 'bitcoin news', 'truth', 'crash', 'mario', 'league of legends', 'wii', 'mmorpg', 'grand theft auto v', 'health', 'marvel', 'racing', 'apple', 'instrumental', 'earth', 'destiny', 'satire', 'race', 'training', 'electronic', 'boss', 'roblox', 'family friendly', 'california', 'react', 'christian', 'mmo', 'twitter', 'help', 'star', 'cars', 'random', 'top 10', 'ninja', 'guns', 'linux', 'lessons', 'vegan', 'future', 'dota 2', 'studio', 'star wars', 'gta 5', 'shooting', 'nasa', 'rock', 'league', 'subscribe', 'water', 'gta v', 'car', 'samsung', 'music video', 'skyrim', 'dog', 'comics', 'shooter game', 'bo3', 'halloween', 'liberty', 'eth', 'conspiracy', 'knife', 'fashion', 'stories', 'vapor', 'nvidia', 'cute', 'beat', 'nintendo switch', 'fantasy', 'christmas', 'world of warcraft', 'industry', 'cartoon', 'crypto news', 'garden', 'animals', 'windows', 'happy', 'magic', 'memes', 'design', 'tactical', 'fallout 4', 'puzzle', 'parody', 'rv', 'beats', 'fortnite battle royale', 'building', 'disney', 'drone', 'ps2', 'beach', 'metal', 'christianity', 'business', 'mix', 'bo2', 'cover', 'senate', '4k', 'united states', 'final', 'hero', 'playing', 'dlc', 'ubisoft', 'halo', 'pc gaming', 'raw', 'investing', 'online learning', 'software', 'ark', 'mojang', 'console', 'battle royale', 'canon', 'microsoft', 'camping', 'cryptocurrency news', 'ufo', 'progressive talk', 'switch', 'fpv', 'arcade', 'school', 'driving', 'bodybuilding', 'drama', 'retro', 'science fiction', 'eggs', 'australia', 'modded', 'rainbow', 'gamers', 'resident evil', 'drawing', 'brasil', 'england', 'hillary clinton', 'singing', 'final fantasy', 'hiphop', 'video blog', 'mature', 'quad', 'noob', 'simulation', 'illuminati', 'poetry', 'dayz', 'manga', 'howto', 'insane', 'xbox360', 'press', 'special', 'church', 'ico', 'weird', 'libertarian', 'crafting', 'level', 'comic', 'sandbox', 'daily vlog', 'outdoor', 'black ops', 'sound', 'christ', 'duty', 'Juvenile fiction', 'pc game', 'how-to', 'ww2', 'creepy', 'artist', 'galaxy', 'destiny 2', 'new music', 'quest', 'lee', 'pacman', 'super smash bros', 'day', 'survival horror', 'patreon', 'bitcoin price', 'trending', 'open world', 'wii u', 'dope', 'reaper', 'sniping', 'dubstep', 'truck', 'planet', 'dc', 'amazon', 'spirituality', 'universe', 'video game culture', 'community', 'cat', 'aliens', 'tourism', 'altcoins', 'style', 'travel trailer', 'rda', '5859dfec-026f-46ba-bea0-02bf43aa1a6f', 'gun', 'secret', 'far cry 5', 'auto', 'culture', 'dj', 'mw2', 'lord', 'full time rving', 'role-playing game', 'prank', 'grand theft auto', 'master', 'wrestling', 'sci-fi', 'workout', 'ghost', 'fake news', 'silly', 'season', 'bo4', 'trading', 'extreme', 'economy', 'combat', 'plays', 'muslim', 'pubg mobile', 'clips', 'bo1', 'paypal', 'sims', 'exploration', 'light', 'ripple', 'paranormal', 'football', 'capcom', 'rta', 'discord', 'action role-playing game', 'playthrough part', 'batman', 'player', 'server', 'anarchy', 'military', 'playlist', 'cosplay', 'rv park', 'rant', 'edit', 'germany', 'reading', 'chris', 'flash', 'loot', 'bitcoin gratis', 'game reviews', 'movies', 'stupid', 'latest news', 'squad gameplay', 'guru', 'timelapse', 'black ops 3', 'holiday', 'soul', 'motivation', 'mw3', 'vacation', 'sega', '19th century', 'pop', 'sims 4', 'post', 'smok', 'island', 'scotland', 'paladins', 'warrior', 'creepypasta', 'role-playing video game', 'solar', 'vr', 'animal', 'peace', 'consciousness', 'dota', 'audio', 'mass effect', 'Humour', 'first look', 'videogames', 'future bass', 'freestyle', 'hardcore', 'portugal', 'dantdm', 'teaser', 'lbry']; +const DEFAULT_KNOWN_TAGS = ['free speech', 'censorship', 'gaming', 'pop culture', 'entertainment', 'technology', 'music', 'funny', 'education', 'learning', 'news', 'gameplay', 'nature', 'beliefs', 'comedy', 'games', 'film & animation', 'game', 'weapons', 'blockchain', 'video game', 'sports', 'walkthrough', 'art', 'pc', 'minecraft', 'playthrough', 'economics', 'automotive', 'play', 'tutorial', 'twitch', 'how to', 'ps4', 'bitcoin', 'fortnite', 'commentary', 'lets play', 'fun', 'politics', 'travel', 'food', 'science', 'xbox', 'liberal', 'democrat', 'progressive', 'survival', 'non-profits', 'activism', 'cryptocurrency', 'playstation', 'nintendo', 'government', 'steam', 'podcast', 'gamer', 'horror', 'conservative', 'reaction', 'trailer', 'love', 'cnn', 'republican', 'political', 'hangoutsonair', 'hoa', 'msnbc', 'cbs', 'anime', 'donald trump', 'fiction', 'fox news', 'crypto', 'ethereum', 'call of duty', 'android', 'multiplayer', 'epic', 'rpg', 'adventure', 'secular talk', 'btc', 'atheist', 'atheism', 'video games', 'ps3', 'cod', 'online', 'agnostic', 'movie', 'fps', 'lets', 'mod', 'world', 'reviews', 'sharefactory', 'space', 'pokemon', 'stream', 'hilarious', 'lol', 'sony', 'god', 'dance', 'pvp', 'tech', 'strategy', 'zombies', 'fail', 'film', 'xbox360', 'animation', 'unboxing', 'money', 'wwe', 'mods', 'indie', 'pubg', 'ios', 'history', 'rap', 'mobile', 'trump', 'hack', 'flat earth', 'trap', 'humor', 'vlogging', 'fox', 'news radio', 'facebook', 'edm', 'fitness', 'vaping', 'hip hop', 'secular', 'jesus', 'song', 'vape', 'guitar', 'remix', 'mining', 'daily', 'diy', 'pets', 'videogame', 'death', 'funny moments', 'religion', 'media', 'viral', 'war', 'nbc', 'freedom', 'gold', 'family', 'meme', 'zombie', 'photography', 'chill', 'sniper', 'computer', 'iphone', 'dragon', 'bible', 'pro', 'overwatch', 'litecoin', 'gta', 'house', 'fire', 'bass', 'truth', 'crash', 'mario', 'league of legends', 'wii', 'mmorpg', 'health', 'marvel', 'racing', 'apple', 'instrumental', 'earth', 'destiny', 'satire', 'race', 'training', 'electronic', 'boss', 'roblox', 'family friendly', 'california', 'react', 'christian', 'mmo', 'twitter', 'help', 'star', 'cars', 'random', 'top 10', 'ninja', 'guns', 'linux', 'lessons', 'vegan', 'future', 'dota 2', 'studio', 'star wars', 'shooting', 'nasa', 'rock', 'league', 'subscribe', 'water', 'gta v', 'car', 'samsung', 'music video', 'skyrim', 'dog', 'comics', 'shooter game', 'bo3', 'halloween', 'liberty', 'eth', 'conspiracy', 'knife', 'fashion', 'stories', 'vapor', 'nvidia', 'cute', 'beat', 'nintendo switch', 'fantasy', 'christmas', 'world of warcraft', 'industry', 'cartoon', 'garden', 'animals', 'windows', 'happy', 'magic', 'memes', 'design', 'tactical', 'fallout 4', 'puzzle', 'parody', 'rv', 'beats', 'building', 'disney', 'drone', 'ps2', 'beach', 'metal', 'christianity', 'business', 'mix', 'bo2', 'cover', 'senate', '4k', 'united states', 'final', 'hero', 'playing', 'dlc', 'ubisoft', 'halo', 'pc gaming', 'raw', 'investing', 'online learning', 'software', 'ark', 'mojang', 'console', 'battle royale', 'canon', 'microsoft', 'camping', 'ufo', 'progressive talk', 'switch', 'fpv', 'arcade', 'school', 'driving', 'bodybuilding', 'drama', 'retro', 'science fiction', 'eggs', 'australia', 'modded', 'rainbow', 'gamers', 'resident evil', 'drawing', 'brasil', 'england', 'hillary clinton', 'singing', 'final fantasy', 'hiphop', 'video blog', 'mature', 'quad', 'noob', 'simulation', 'illuminati', 'poetry', 'dayz', 'manga', 'howto', 'insane', 'press', 'special', 'church', 'ico', 'weird', 'libertarian', 'crafting', 'level', 'comic', 'sandbox', 'daily vlog', 'outdoor', 'black ops', 'sound', 'christ', 'duty', 'juvenile fiction', 'pc game', 'how-to', 'ww2', 'creepy', 'artist', 'galaxy', 'destiny 2', 'new music', 'quest', 'lee', 'pacman', 'super smash bros', 'day', 'survival horror', 'patreon', 'bitcoin price', 'trending', 'open world', 'wii u', 'dope', 'reaper', 'sniping', 'dubstep', 'truck', 'planet', 'dc', 'amazon', 'spirituality', 'universe', 'video game culture', 'community', 'cat', 'aliens', 'tourism', 'altcoins', 'style', 'travel trailer', 'rda', 'gun', 'secret', 'far cry 5', 'auto', 'culture', 'dj', 'mw2', 'lord', 'full time rving', 'role-playing game', 'prank', 'grand theft auto', 'master', 'wrestling', 'sci-fi', 'workout', 'ghost', 'fake news', 'silly', 'season', 'bo4', 'trading', 'extreme', 'economy', 'combat', 'plays', 'muslim', 'pubg mobile', 'clips', 'bo1', 'paypal', 'sims', 'exploration', 'light', 'ripple', 'paranormal', 'football', 'capcom', 'rta', 'discord', 'batman', 'player', 'server', 'anarchy', 'military', 'playlist', 'cosplay', 'rv park', 'rant', 'edit', 'germany', 'reading', 'chris', 'flash', 'loot', 'bitcoin gratis', 'game reviews', 'movies', 'stupid', 'latest news', 'squad gameplay', 'guru', 'timelapse', 'black ops 3', 'holiday', 'soul', 'motivation', 'mw3', 'vacation', 'sega', '19th century', 'pop', 'sims 4', 'post', 'smok', 'island', 'scotland', 'paladins', 'warrior', 'creepypasta', 'role-playing', 'solar', 'vr', 'animal', 'peace', 'consciousness', 'dota', 'audio', 'mass effect', 'humour', 'first look', 'videogames', 'future bass', 'freestyle', 'hardcore', 'portugal', 'dantdm', 'teaser', 'lbry']; // @@ -5653,7 +5653,7 @@ function getDefaultKnownTags() { } const defaultState$8 = { - followedTags: DEFAULT_FOLLOWED_TAGS, + followedTags: [], knownTags: getDefaultKnownTags() }; @@ -5702,9 +5702,12 @@ const tagsReducer = handleActions({ }, [USER_STATE_POPULATE]: (state, action) => { const { tags } = action.data; - return _extends$g({}, state, { - followedTags: tags && tags.length ? tags : DEFAULT_FOLLOWED_TAGS - }); + if (Array.isArray(tags)) { + return _extends$g({}, state, { + followedTags: tags + }); + } + return _extends$g({}, state); } }, defaultState$8); diff --git a/src/redux/reducers/tags.js b/src/redux/reducers/tags.js index 206abf6..b465376 100644 --- a/src/redux/reducers/tags.js +++ b/src/redux/reducers/tags.js @@ -14,7 +14,7 @@ function getDefaultKnownTags() { } const defaultState: TagState = { - followedTags: DEFAULT_FOLLOWED_TAGS, + followedTags: [], knownTags: getDefaultKnownTags(), }; @@ -70,10 +70,16 @@ export const tagsReducer = handleActions( action: { data: { tags: ?Array } } ) => { const { tags } = action.data; + if (Array.isArray(tags)) { + return { + ...state, + followedTags: tags, + }; + } return { ...state, - followedTags: tags && tags.length ? tags : DEFAULT_FOLLOWED_TAGS, }; + }, }, defaultState -- 2.45.3