Skip to content

Commit

Permalink
fixed section id issue
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 31, 2023
1 parent 0e6a43e commit 36918ae
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/routes/search/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@
}
onMount(async () => {
if (listElement) {
listElement.addEventListener('scroll', async () => {
if (!allLoaded && listElement.scrollTop + listElement.clientHeight >= listElement.scrollHeight) {
loadMore()
}
})
}
})
$: useOueryEffect(async () => {
initialLoad = true
resetSkipLimit()
switch (sectionId) {
case 'weekly':
title = `Weekly`
Expand All @@ -90,6 +78,18 @@
title = `Fav channels`
break
}
if (listElement) {
listElement.addEventListener('scroll', async () => {
if (!allLoaded && listElement.scrollTop + listElement.clientHeight >= listElement.scrollHeight) {
loadMore()
}
})
}
})
$: useOueryEffect(async () => {
initialLoad = true
resetSkipLimit()
await loadMore()
initialLoad = false
time = Date.now()
Expand All @@ -110,6 +110,9 @@
placeholder="Search {placeholderText}"
class="input input-bordered input-primary w-96" />
<input type="hidden" name="time" value={time}/>
{#if sectionId}
<input type="hidden" name="section" value={sectionId}/>
{/if}
<button
class="btn btn-square btn-neutral text-white"
>
Expand Down

0 comments on commit 36918ae

Please sign in to comment.