Compare commits
4 Commits
bump-light
...
testapi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63bd8ba420 | ||
|
|
3f5caebf77 | ||
|
|
f63956a08b | ||
|
|
e5b0c85747 |
@@ -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 === '/') {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user