mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-05 05:15:22 +00:00
Reorganize; no functional change
This commit is contained in:
parent
c278adc1c6
commit
89a0d5e597
1 changed files with 44 additions and 34 deletions
|
@ -86,18 +86,14 @@ export function prioritizeActiveLivestreams(
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
prefixUris?: Array<string>,
|
prefixUris?: Array<string>,
|
||||||
|
pinUrls?: Array<string>,
|
||||||
uris: Array<string>,
|
uris: Array<string>,
|
||||||
doClaimSearch: ({}) => void,
|
liveLivestreamsFirst?: boolean,
|
||||||
showNsfw: boolean,
|
livestreamMap?: { [string]: any },
|
||||||
hideReposts: boolean,
|
showNoSourceClaims?: boolean,
|
||||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
renderProperties?: (Claim) => ?Node,
|
||||||
claimSearchByQuery: { [string]: Array<string> },
|
|
||||||
fetchingClaimSearchByQuery: { [string]: boolean },
|
|
||||||
claimsByUri: { [string]: any },
|
|
||||||
// claim search options are below
|
// claim search options are below
|
||||||
tags: Array<string>,
|
tags: Array<string>,
|
||||||
blockedUris: Array<string>,
|
|
||||||
mutedUris: Array<string>,
|
|
||||||
claimIds?: Array<string>,
|
claimIds?: Array<string>,
|
||||||
channelIds?: Array<string>,
|
channelIds?: Array<string>,
|
||||||
pageSize: number,
|
pageSize: number,
|
||||||
|
@ -111,11 +107,16 @@ type Props = {
|
||||||
limitClaimsPerChannel?: number,
|
limitClaimsPerChannel?: number,
|
||||||
hasSource?: boolean,
|
hasSource?: boolean,
|
||||||
hasNoSource?: boolean,
|
hasNoSource?: boolean,
|
||||||
renderProperties?: (Claim) => ?Node,
|
// --- select ---
|
||||||
liveLivestreamsFirst?: boolean,
|
claimSearchByQuery: { [string]: Array<string> },
|
||||||
livestreamMap?: { [string]: any },
|
claimsByUri: { [string]: any },
|
||||||
pinUrls?: Array<string>,
|
fetchingClaimSearchByQuery: { [string]: boolean },
|
||||||
showNoSourceClaims?: boolean,
|
showNsfw: boolean,
|
||||||
|
hideReposts: boolean,
|
||||||
|
mutedUris: Array<string>,
|
||||||
|
blockedUris: Array<string>,
|
||||||
|
// --- perform ---
|
||||||
|
doClaimSearch: ({}) => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClaimTilesDiscover(props: Props) {
|
function ClaimTilesDiscover(props: Props) {
|
||||||
|
@ -269,6 +270,33 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const modifiedUris = uris ? uris.slice() : [];
|
||||||
|
const fixUris = pinUrls || [];
|
||||||
|
|
||||||
|
if (pinUrls && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
|
||||||
|
fixUris.forEach((fixUri) => {
|
||||||
|
if (modifiedUris.indexOf(fixUri) !== -1) {
|
||||||
|
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
|
||||||
|
} else {
|
||||||
|
modifiedUris.pop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
modifiedUris.splice(2, 0, ...fixUris);
|
||||||
|
}
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
function resolveLive(index) {
|
||||||
|
if (liveLivestreamsFirst && livestreamMap && index < liveUris.length) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (shouldPerformSearch) {
|
if (shouldPerformSearch) {
|
||||||
const searchOptions = JSON.parse(optionsStringForEffect);
|
const searchOptions = JSON.parse(optionsStringForEffect);
|
||||||
|
@ -286,26 +314,8 @@ function ClaimTilesDiscover(props: Props) {
|
||||||
}
|
}
|
||||||
}, [shouldPerformSearch, prevUris, uris]);
|
}, [shouldPerformSearch, prevUris, uris]);
|
||||||
|
|
||||||
const resolveLive = (index) => {
|
// **************************************************************************
|
||||||
if (liveLivestreamsFirst && livestreamMap && index < liveUris.length) {
|
// **************************************************************************
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
const modifiedUris = uris ? uris.slice() : [];
|
|
||||||
const fixUris = pinUrls || [];
|
|
||||||
|
|
||||||
if (pinUrls && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {
|
|
||||||
fixUris.forEach((fixUri) => {
|
|
||||||
if (modifiedUris.indexOf(fixUri) !== -1) {
|
|
||||||
modifiedUris.splice(modifiedUris.indexOf(fixUri), 1);
|
|
||||||
} else {
|
|
||||||
modifiedUris.pop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
modifiedUris.splice(2, 0, ...fixUris);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ul className="claim-grid">
|
<ul className="claim-grid">
|
||||||
|
|
Loading…
Add table
Reference in a new issue