Merge pull request #75 from lbryio/0.45-support

Fix: pagination support
This commit is contained in:
Sean Yesmunt 2019-11-13 16:32:17 -05:00 committed by GitHub
commit 9738f36bf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 24 deletions

14
dist/bundle.es.js vendored
View file

@ -525,8 +525,11 @@ rewards.claimReward = (type, rewardParams) => {
switch (type) {
case rewards.TYPE_FIRST_CHANNEL:
lbryRedux.Lbry.claim_list().then(claims => {
const claim = claims.find(foundClaim => foundClaim.name.length && foundClaim.name[0] === '@' && foundClaim.txid.length && foundClaim.type === 'claim');
lbryRedux.Lbry.channel_list({
page: 1,
page_size: 10
}).then(claims => {
const claim = claims.items && claims.items.find(foundClaim => foundClaim.name.length && foundClaim.name[0] === '@' && foundClaim.txid.length && foundClaim.type === 'claim');
if (claim) {
params.transaction_id = claim.txid;
@ -538,8 +541,11 @@ rewards.claimReward = (type, rewardParams) => {
break;
case rewards.TYPE_FIRST_PUBLISH:
lbryRedux.Lbry.claim_list().then(claims => {
const claim = claims.find(foundClaim => foundClaim.name.length && foundClaim.name[0] !== '@' && foundClaim.txid.length && foundClaim.type === 'claim');
lbryRedux.Lbry.stream_list({
page: 1,
page_size: 10
}).then(claims => {
const claim = claims.items && claims.items.find(foundClaim => foundClaim.name.length && foundClaim.name[0] !== '@' && foundClaim.txid.length && foundClaim.type === 'claim');
if (claim) {
params.transaction_id = claim.txid;

14
dist/bundle.js vendored
View file

@ -1289,8 +1289,11 @@ rewards.claimReward = function (type, rewardParams) {
switch (type) {
case rewards.TYPE_FIRST_CHANNEL:
lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].claim_list().then(function (claims) {
var claim = claims.find(function (foundClaim) {
lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].channel_list({
page: 1,
page_size: 10
}).then(function (claims) {
var claim = claims.items && claims.items.find(function (foundClaim) {
return foundClaim.name.length && foundClaim.name[0] === '@' && foundClaim.txid.length && foundClaim.type === 'claim';
});
@ -1304,8 +1307,11 @@ rewards.claimReward = function (type, rewardParams) {
break;
case rewards.TYPE_FIRST_PUBLISH:
lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].claim_list().then(function (claims) {
var claim = claims.find(function (foundClaim) {
lbry_redux__WEBPACK_IMPORTED_MODULE_0__["Lbry"].stream_list({
page: 1,
page_size: 10
}).then(function (claims) {
var claim = claims.items && claims.items.find(function (foundClaim) {
return foundClaim.name.length && foundClaim.name[0] !== '@' && foundClaim.txid.length && foundClaim.type === 'claim';
});

View file

@ -53,9 +53,11 @@ rewards.claimReward = (type, rewardParams) => {
switch (type) {
case rewards.TYPE_FIRST_CHANNEL:
Lbry.claim_list()
Lbry.channel_list({ page: 1, page_size: 10 })
.then(claims => {
const claim = claims.find(
const claim =
claims.items &&
claims.items.find(
foundClaim =>
foundClaim.name.length &&
foundClaim.name[0] === '@' &&
@ -73,9 +75,11 @@ rewards.claimReward = (type, rewardParams) => {
break;
case rewards.TYPE_FIRST_PUBLISH:
Lbry.claim_list()
Lbry.stream_list({ page: 1, page_size: 10 })
.then(claims => {
const claim = claims.find(
const claim =
claims.items &&
claims.items.find(
foundClaim =>
foundClaim.name.length &&
foundClaim.name[0] !== '@' &&