Compare commits

...

4 Commits

Author SHA1 Message Date
zeppi
63bd8ba420 test api 2021-06-18 10:29:18 -04:00
drewhancock
3f5caebf77 changed pins
removed some orginary gamers
added adrian logan
2021-06-16 14:16:59 -05:00
zeppi
f63956a08b bump lighthouse throttle 2021-06-16 14:45:25 -04:00
zeppi
e5b0c85747 bump lightouse throttle 2021-06-16 14:12:58 -04:00
4 changed files with 10 additions and 6 deletions

View File

@@ -286,7 +286,7 @@ function ClaimTilesDiscover(props: Props) {
const modifiedUris = uris ? uris.slice() : [];
const fixUris = [
'lbry://@SomeOrdinaryGamers#a/xbox-e3-2021-was-really-good...#0',
'lbry://@AdrianLogan#5/why-i-talk-to-myself#3',
];
if (pin && modifiedUris && modifiedUris.length > 2 && window.location.pathname === '/') {

View File

@@ -46,6 +46,7 @@ export default function WunderBarSuggestions(props: Props) {
const inputRef: ElementRef<any> = React.useRef();
const isFocused = inputRef && inputRef.current && inputRef.current === document.activeElement;
const THROTTLE_MS = 1000;
const {
push,
location: { search },
@@ -53,7 +54,7 @@ export default function WunderBarSuggestions(props: Props) {
const urlParams = new URLSearchParams(search);
const queryFromUrl = urlParams.get('q') || '';
const [term, setTerm] = React.useState(queryFromUrl);
const throttledTerm = useThrottle(term, 500) || '';
const throttledTerm = useThrottle(term, THROTTLE_MS) || '';
const searchSize = isMobile ? 20 : 5;
const { results, loading } = useLighthouse(throttledTerm, showMature, searchSize);
const noResults = throttledTerm && !loading && results && results.length === 0;

View File

@@ -1,3 +1,3 @@
export const BITWAVE_EMBED_URL = 'https://bitwave.tv/odysee';
export const BITWAVE_LIVE_API = 'https://api.bitwave.tv/v1/odysee/live';
export const BITWAVE_LIVE_API = 'https://api.live.odysee.com/v1/odysee/live';
export const BITWAVE_REPLAY_API = 'https://api.bitwave.tv/v1/replays/odysee';

View File

@@ -6,10 +6,11 @@ import { isURIValid } from 'lbry-redux';
import useThrottle from './use-throttle';
export default function useLighthouse(query: string, showMature?: boolean, size?: number = 5) {
const THROTTLE_MS = 1000;
const [results, setResults] = React.useState();
const [loading, setLoading] = React.useState();
const queryString = query ? getSearchQueryString(query, { nsfw: showMature, size }) : '';
const throttledQuery = useThrottle(queryString, 500);
const throttledQuery = useThrottle(queryString, THROTTLE_MS);
React.useEffect(() => {
if (throttledQuery) {
@@ -19,9 +20,11 @@ export default function useLighthouse(query: string, showMature?: boolean, size?
let isSubscribed = true;
lighthouse
.search(throttledQuery)
.then(results => {
.then((results) => {
if (isSubscribed) {
setResults(results.map(result => `lbry://${result.name}#${result.claimId}`).filter(uri => isURIValid(uri)));
setResults(
results.map((result) => `lbry://${result.name}#${result.claimId}`).filter((uri) => isURIValid(uri))
);
setLoading(false);
}
})