Skip to content

Commit

Permalink
some download stuf
Browse files Browse the repository at this point in the history
  • Loading branch information
Robonau committed Aug 6, 2023
1 parent 2154069 commit 17ae1dd
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions src/routes/(app)/downloads/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,27 @@
import { fade } from 'svelte/transition';
let dl = downloadChanged({});
let dataa: DownloadChangedSubscription | null | undefined = {
__typename: 'Subscription',
downloadChanged: {
__typename: 'DownloadStatus',
state: DownloaderState.Started,
queue: [
{
__typename: 'DownloadType',
progress: 50,
state: DownloadState.Downloading,
tries: 1,
chapter: { __typename: 'ChapterType', name: 'test chap', id: 45648 },
manga: {
__typename: 'MangaType',
title: 'test title',
thumbnailUrl: '/api/v1/manga/561/thumbnail',
id: 561
}
}
]
}
}; // JUST TESTING DATA SINCE WEBSOCKET ISNT CURRENTLY WORKING
dl.subscribe((e) => (dataa = e.data));
let dataa: DownloadChangedSubscription | null | undefined;
dl.subscribe((e) => {
console.log(e.errors);
console.log(e.data);
dataa = e.data;
});
</script>

<div class="flex flex-col h-full absolute top-0 bottom-0 left-0 right-0">
<div class="flex flex-wrap w-full top-0 z-10 shrink-0">
<div class="bg-base-200 w-full rounded-b-lg p-1 mx-1">static buttons</div>
<div class="bg-base-200 w-full rounded-b-lg p-1 mx-1">static_buttons</div>
</div>
<div>{dataa?.downloadChanged.state}</div>
<div class="overflow-y-auto snap-y snap-proximity">
{#if dataa?.downloadChanged.queue}
{#each dataa.downloadChanged.queue as item}
{#each dataa.downloadChanged.queue as item (item.chapter.id)}
<IntersectionObserver
let:intersecting
top={400}
bottom={400}
class="bg-base-200 h-32 m-1 rounded-lg snap-end"
class="bg-base-200 h-32 m-1 rounded-lg snap-start"
>
{#if intersecting}
<a in:fade|global href="/manga/{item.manga.id}">
Expand Down

0 comments on commit 17ae1dd

Please sign in to comment.