changes for 38
This commit is contained in:
parent
a01b919c72
commit
1b98a13082
7 changed files with 68 additions and 38 deletions
35
dist/bundle.es.js
vendored
35
dist/bundle.es.js
vendored
|
@ -1975,13 +1975,22 @@ function doResolveUris(uris, returnCachedClaims = false) {
|
|||
|
||||
// Flow has terrible Object.entries support
|
||||
// https://github.com/facebook/flow/issues/2221
|
||||
// $FlowFixMe
|
||||
if (uriResolveInfo.error) {
|
||||
resolveInfo[uri] = _extends$3({}, fallbackResolveInfo);
|
||||
} else {
|
||||
// $FlowFixMe
|
||||
const { claim, certificate, claims_in_channel: claimsInChannel } = uriResolveInfo;
|
||||
resolveInfo[uri] = { claim, certificate, claimsInChannel };
|
||||
if (uriResolveInfo) {
|
||||
if (uriResolveInfo.error) {
|
||||
resolveInfo[uri] = _extends$3({}, fallbackResolveInfo);
|
||||
} else {
|
||||
let result = {};
|
||||
if (uriResolveInfo.value_type === 'channel') {
|
||||
result.certificate = uriResolveInfo;
|
||||
// $FlowFixMe
|
||||
result.claimsInChannel = uriResolveInfo.meta.claims_in_channel;
|
||||
} else {
|
||||
result.claim = uriResolveInfo;
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
resolveInfo[uri] = result;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -2095,7 +2104,7 @@ function doFetchClaimsByChannel(uri, page = 1) {
|
|||
data: { uri, page }
|
||||
});
|
||||
|
||||
lbryProxy.claim_search({ channel_name: uri, page: page || 1, winning: true }).then(result => {
|
||||
lbryProxy.claim_search({ channel: uri, controlling: true, page: page || 1 }).then(result => {
|
||||
const { items: claimsInChannel, page: returnedPage } = result;
|
||||
|
||||
dispatch({
|
||||
|
@ -3155,16 +3164,6 @@ reducers$2[LOADING_VIDEO_FAILED] = (state, action) => {
|
|||
});
|
||||
};
|
||||
|
||||
reducers$2[FETCH_DATE] = (state, action) => {
|
||||
const { time } = action.data;
|
||||
if (time) {
|
||||
return Object.assign({}, state, {
|
||||
publishedDate: time
|
||||
});
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
reducers$2[SET_FILE_LIST_SORT] = (state, action) => {
|
||||
const pageSortStates = {
|
||||
[PUBLISHED]: 'fileListPublishedSort',
|
||||
|
|
14
dist/flow-typed/Claim.js
vendored
14
dist/flow-typed/Claim.js
vendored
|
@ -44,6 +44,20 @@ declare type GenericClaim = {
|
|||
type: 'claim' | 'update' | 'support',
|
||||
valid_at_height?: number, // BUG: this should always exist https://github.com/lbryio/lbry/issues/1728
|
||||
value_type: 'stream' | 'channel',
|
||||
meta: {
|
||||
activation_height: number,
|
||||
creation_height: number,
|
||||
creation_timestamp: number,
|
||||
effective_amount: string,
|
||||
expiration_height: number,
|
||||
is_controlling: boolean,
|
||||
support_amount: string,
|
||||
trending_global: number,
|
||||
trending_group: number,
|
||||
trending_local: number,
|
||||
trending_mixed: number,
|
||||
claims_in_channel?: number,
|
||||
},
|
||||
};
|
||||
|
||||
declare type GenericMetadata = {
|
||||
|
|
4
dist/flow-typed/Lbry.js
vendored
4
dist/flow-typed/Lbry.js
vendored
|
@ -67,7 +67,9 @@ declare type ResolveResponse = {
|
|||
// Keys are the url(s) passed to resolve
|
||||
[string]:
|
||||
| { error: {}, certificate: ChannelClaim, claims_in_channel: number }
|
||||
| { error?: {}, claim: StreamClaim, certificate?: ChannelClaim },
|
||||
| StreamClaim
|
||||
| ChannelClaim
|
||||
| { error?: {} },
|
||||
};
|
||||
|
||||
declare type GetResponse = FileListItem;
|
||||
|
|
14
flow-typed/Claim.js
vendored
14
flow-typed/Claim.js
vendored
|
@ -44,6 +44,20 @@ declare type GenericClaim = {
|
|||
type: 'claim' | 'update' | 'support',
|
||||
valid_at_height?: number, // BUG: this should always exist https://github.com/lbryio/lbry/issues/1728
|
||||
value_type: 'stream' | 'channel',
|
||||
meta: {
|
||||
activation_height: number,
|
||||
creation_height: number,
|
||||
creation_timestamp: number,
|
||||
effective_amount: string,
|
||||
expiration_height: number,
|
||||
is_controlling: boolean,
|
||||
support_amount: string,
|
||||
trending_global: number,
|
||||
trending_group: number,
|
||||
trending_local: number,
|
||||
trending_mixed: number,
|
||||
claims_in_channel?: number,
|
||||
},
|
||||
};
|
||||
|
||||
declare type GenericMetadata = {
|
||||
|
|
4
flow-typed/Lbry.js
vendored
4
flow-typed/Lbry.js
vendored
|
@ -67,7 +67,9 @@ declare type ResolveResponse = {
|
|||
// Keys are the url(s) passed to resolve
|
||||
[string]:
|
||||
| { error: {}, certificate: ChannelClaim, claims_in_channel: number }
|
||||
| { error?: {}, claim: StreamClaim, certificate?: ChannelClaim },
|
||||
| StreamClaim
|
||||
| ChannelClaim
|
||||
| { error?: {} },
|
||||
};
|
||||
|
||||
declare type GetResponse = FileListItem;
|
||||
|
|
|
@ -50,13 +50,22 @@ export function doResolveUris(uris: Array<string>, returnCachedClaims: boolean =
|
|||
|
||||
// Flow has terrible Object.entries support
|
||||
// https://github.com/facebook/flow/issues/2221
|
||||
// $FlowFixMe
|
||||
if (uriResolveInfo.error) {
|
||||
resolveInfo[uri] = { ...fallbackResolveInfo };
|
||||
} else {
|
||||
// $FlowFixMe
|
||||
const { claim, certificate, claims_in_channel: claimsInChannel } = uriResolveInfo;
|
||||
resolveInfo[uri] = { claim, certificate, claimsInChannel };
|
||||
if (uriResolveInfo) {
|
||||
if (uriResolveInfo.error) {
|
||||
resolveInfo[uri] = { ...fallbackResolveInfo };
|
||||
} else {
|
||||
let result = {};
|
||||
if (uriResolveInfo.value_type === 'channel') {
|
||||
result.certificate = uriResolveInfo;
|
||||
// $FlowFixMe
|
||||
result.claimsInChannel = uriResolveInfo.meta.claims_in_channel;
|
||||
} else {
|
||||
result.claim = uriResolveInfo;
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
resolveInfo[uri] = result;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -182,7 +191,7 @@ export function doFetchClaimsByChannel(uri: string, page: number = 1) {
|
|||
data: { uri, page },
|
||||
});
|
||||
|
||||
Lbry.claim_search({ channel_name: uri, page: page || 1, winning: true }).then(
|
||||
Lbry.claim_search({ channel: uri, controlling: true, page: page || 1 }).then(
|
||||
(result: ClaimSearchResponse) => {
|
||||
const { items: claimsInChannel, page: returnedPage } = result;
|
||||
|
||||
|
|
|
@ -161,16 +161,6 @@ reducers[ACTIONS.LOADING_VIDEO_FAILED] = (state, action) => {
|
|||
});
|
||||
};
|
||||
|
||||
reducers[ACTIONS.FETCH_DATE] = (state, action) => {
|
||||
const { time } = action.data;
|
||||
if (time) {
|
||||
return Object.assign({}, state, {
|
||||
publishedDate: time,
|
||||
});
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
reducers[ACTIONS.SET_FILE_LIST_SORT] = (state, action) => {
|
||||
const pageSortStates = {
|
||||
[PAGES.PUBLISHED]: 'fileListPublishedSort',
|
||||
|
|
Loading…
Reference in a new issue