mirror of
https://github.com/KevinMidboe/seasoned.git
synced 2026-03-10 03:19:32 +00:00
Only search when query has length
This commit is contained in:
@@ -61,8 +61,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fetchTorrents() {
|
function fetchTorrents() {
|
||||||
loading.value = true;
|
if (!props.query?.length) return;
|
||||||
|
|
||||||
|
loading.value = true;
|
||||||
searchTorrents(props.query)
|
searchTorrents(props.query)
|
||||||
.then(torrentResponse => setTorrents(torrentResponse?.results))
|
.then(torrentResponse => setTorrents(torrentResponse?.results))
|
||||||
.then(() => updateResultCountDisplay())
|
.then(() => updateResultCountDisplay())
|
||||||
|
|||||||
@@ -82,9 +82,9 @@ export function humanMinutes(minutes) {
|
|||||||
return `${hours}h ${minutesLeft}m`;
|
return `${hours}h ${minutesLeft}m`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getValueFromUrlQuery(queryParameter: string): string | null {
|
export function getValueFromUrlQuery(queryParameter: string): string {
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
return params.get(queryParameter) || null;
|
return params.get(queryParameter) || "";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setUrlQueryParameter(parameter: string, value: string): void {
|
export function setUrlQueryParameter(parameter: string, value: string): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user