only start searching for torrents when clicking on search button

This commit is contained in:
maxid
2025-12-21 15:47:09 +01:00
parent 45208105c0
commit 2493b43d4f
2 changed files with 25 additions and 9 deletions

View File

@@ -15,7 +15,7 @@
let { movie } = $props();
let dialogueState = $state(false);
let torrentsPromise: any = $state();
let torrentsPromise: any = $state(null);
let tabState: string = $state('basic');
let isLoading: boolean = $state(false);
let advancedMode: boolean = $derived(tabState === 'advanced');
@@ -73,7 +73,7 @@
}
</script>
<Dialog.Root bind:open={dialogueState} onOpenChange={() => (dialogueState ? search() : null)}>
<Dialog.Root bind:open={dialogueState}>
<Dialog.Trigger class={buttonVariants({ variant: 'default' })}>Download Movie</Dialog.Trigger>
<Dialog.Content class="max-h-[90vh] w-fit min-w-[80vw] overflow-y-auto">
<Dialog.Header>
@@ -168,9 +168,17 @@
</Table.Cell>
</Table.Row>
{:else}
<Table.Cell colspan={7}>
<div class="font-light text-center w-full">No torrents found.</div>
</Table.Cell>
{#if data === null}
<Table.Cell colspan={7}>
<div class="font-light text-center w-full">
Start searching by clicking the search button!
</div>
</Table.Cell>
{:else}
<Table.Cell colspan={7}>
<div class="font-light text-center w-full">No torrents found.</div>
</Table.Cell>
{/if}
{/each}
</Table.Body>
</Table.Root>

View File

@@ -73,7 +73,7 @@
}
</script>
<Dialog.Root bind:open={dialogueState} onOpenChange={() => (dialogueState ? search() : null)}>
<Dialog.Root bind:open={dialogueState}>
<Dialog.Trigger class={buttonVariants({ variant: 'default' })}>Download Seasons</Dialog.Trigger>
<Dialog.Content class="max-h-[90vh] w-fit min-w-[80vw] overflow-y-auto">
<Dialog.Header>
@@ -202,9 +202,17 @@
</Table.Cell>
</Table.Row>
{:else}
<Table.Cell colspan={7}>
<div class="font-light text-center w-full">No torrents found.</div>
</Table.Cell>
{#if data === null}
<Table.Cell colspan={7}>
<div class="font-light text-center w-full">
Start searching by clicking the search button!
</div>
</Table.Cell>
{:else}
<Table.Cell colspan={7}>
<div class="font-light text-center w-full">No torrents found.</div>
</Table.Cell>
{/if}
{/each}
</Table.Body>
</Table.Root>