Merge pull request #50 from lbryio/builduri-warnings

fix for buildURI warnings in setSubscriptionsLatest
This commit is contained in:
Akinwale Ariwodola 2019-08-27 16:26:04 +01:00 committed by GitHub
commit 396e8fff4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1368 additions and 48 deletions

12
dist/bundle.es.js vendored
View file

@ -1603,15 +1603,17 @@ const doCheckSubscription = (subscriptionUri, shouldNotify) => (dispatch, getSta
// This allows the app to know if there has been new content since it was last set // This allows the app to know if there has been new content since it was last set
const latestClaim = claimsInChannel[0];
const latestClaimChannel = latestClaim.signing_channel.name;
dispatch(setSubscriptionLatest({ dispatch(setSubscriptionLatest({
channelName: claimsInChannel[0].channel_name, channelName: latestClaimChannel,
uri: lbryRedux.buildURI({ uri: lbryRedux.buildURI({
channelName: claimsInChannel[0].channel_name, channelName: latestClaimChannel,
claimId: claimsInChannel[0].claim_id claimId: latestClaim.claim_id
}, false) }, false)
}, lbryRedux.buildURI({ }, lbryRedux.buildURI({
claimName: claimsInChannel[0].name, claimName: latestClaim.name,
claimId: claimsInChannel[0].claim_id claimId: latestClaim.claim_id
}, false))); // calling FETCH_CHANNEL_CLAIMS_COMPLETED after not calling STARTED }, false))); // calling FETCH_CHANNEL_CLAIMS_COMPLETED after not calling STARTED
// means it will delete a non-existant fetchingChannelClaims[uri] // means it will delete a non-existant fetchingChannelClaims[uri]

17
dist/bundle.js vendored
View file

@ -2599,7 +2599,7 @@ var doCheckSubscription = function doCheckSubscription(subscriptionUri, shouldNo
var newUnread = []; var newUnread = [];
claimsInChannel.slice(0, latestIndexToNotify).forEach(function (claim) { claimsInChannel.slice(0, latestIndexToNotify).forEach(function (claim) {
var uri = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_3__["buildURI"])({ var uri = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_3__["buildURI"])({
contentName: claim.name, claimName: claim.name,
claimId: claim.claim_id claimId: claim.claim_id
}, true); }, true);
var shouldDownload = shouldAutoDownload && Boolean(downloadCount < SUBSCRIPTION_DOWNLOAD_LIMIT && !claim.value.stream.metadata.fee); // Add the new content to the list of "un-read" subscriptions var shouldDownload = shouldAutoDownload && Boolean(downloadCount < SUBSCRIPTION_DOWNLOAD_LIMIT && !claim.value.stream.metadata.fee); // Add the new content to the list of "un-read" subscriptions
@ -2620,15 +2620,17 @@ var doCheckSubscription = function doCheckSubscription(subscriptionUri, shouldNo
// This allows the app to know if there has been new content since it was last set // This allows the app to know if there has been new content since it was last set
var latestClaim = claimsInChannel[0];
var latestClaimChannel = latestClaim.signing_channel.name;
dispatch(setSubscriptionLatest({ dispatch(setSubscriptionLatest({
channelName: claimsInChannel[0].channel_name, channelName: latestClaimChannel,
uri: Object(lbry_redux__WEBPACK_IMPORTED_MODULE_3__["buildURI"])({ uri: Object(lbry_redux__WEBPACK_IMPORTED_MODULE_3__["buildURI"])({
channelName: claimsInChannel[0].channel_name, channelName: latestClaimChannel,
claimId: claimsInChannel[0].claim_id claimId: latestClaim.claim_id
}, false) }, false)
}, Object(lbry_redux__WEBPACK_IMPORTED_MODULE_3__["buildURI"])({ }, Object(lbry_redux__WEBPACK_IMPORTED_MODULE_3__["buildURI"])({
contentName: claimsInChannel[0].name, claimName: latestClaim.name,
claimId: claimsInChannel[0].claim_id claimId: latestClaim.claim_id
}, false))); // calling FETCH_CHANNEL_CLAIMS_COMPLETED after not calling STARTED }, false))); // calling FETCH_CHANNEL_CLAIMS_COMPLETED after not calling STARTED
// means it will delete a non-existant fetchingChannelClaims[uri] // means it will delete a non-existant fetchingChannelClaims[uri]
@ -3928,8 +3930,7 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].AUTHENTICATION_FAILU
reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_STARTED] = function (state) { reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_STARTED] = function (state) {
return Object.assign({}, state, { return Object.assign({}, state, {
userIsPending: true, userIsPending: true
user: defaultState.user
}); });
}; };

View file

@ -21,7 +21,7 @@
"main": "dist/bundle.js", "main": "dist/bundle.js",
"module": "dist/bundle.es.js", "module": "dist/bundle.es.js",
"scripts": { "scripts": {
"build": "rollup --config", "build": "rollup --config && webpack",
"dev": "rollup --config --watch", "dev": "rollup --config --watch",
"precommit": "lint-staged", "precommit": "lint-staged",
"preinstall": "yarn cache clean lbry-redux", "preinstall": "yarn cache clean lbry-redux",
@ -59,7 +59,9 @@
"rollup": "^1.8.0", "rollup": "^1.8.0",
"rollup-plugin-babel": "^4.3.2", "rollup-plugin-babel": "^4.3.2",
"rollup-plugin-flow": "^1.1.1", "rollup-plugin-flow": "^1.1.1",
"rollup-plugin-includepaths": "^0.2.3" "rollup-plugin-includepaths": "^0.2.3",
"webpack": "^4.5.0",
"webpack-cli": "^3.3.7"
}, },
"engines": { "engines": {
"yarn": "^1.3" "yarn": "^1.3"

View file

@ -213,22 +213,21 @@ export const doCheckSubscription = (subscriptionUri: string, shouldNotify?: bool
// Set the latest piece of content for a channel // Set the latest piece of content for a channel
// This allows the app to know if there has been new content since it was last set // This allows the app to know if there has been new content since it was last set
const latestClaim = claimsInChannel[0];
const latestClaimChannel = latestClaim.signing_channel.name;
dispatch( dispatch(
setSubscriptionLatest( setSubscriptionLatest(
{ {
channelName: claimsInChannel[0].channel_name, channelName: latestClaimChannel,
uri: buildURI( uri: buildURI(
{ {
channelName: claimsInChannel[0].channel_name, channelName: latestClaimChannel,
claimId: claimsInChannel[0].claim_id, claimId: latestClaim.claim_id,
}, },
false false
), ),
}, },
buildURI( buildURI({ claimName: latestClaim.name, claimId: latestClaim.claim_id }, false)
{ claimName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id },
false
)
) )
); );

1368
yarn.lock

File diff suppressed because it is too large Load diff