Remove some event dispatchers
This commit is contained in:
@@ -13,21 +13,20 @@ export type TorrentFile = {
|
||||
};
|
||||
</script>
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import Magnet from "icons/Magnet.svelte";
|
||||
import { formatDate } from "util/Formatting"
|
||||
import TorrentItem from "./TorrentItem.svelte"
|
||||
import IconBlock from "layout/IconBlock.svelte";
|
||||
import TextBlock from "layout/TextBlock.svelte"
|
||||
import { fs_node_icon, fs_path_url } from "lib/FilesystemAPI.svelte";
|
||||
import { fs_node_icon, fs_path_url, FSNode } from "lib/FilesystemAPI.svelte";
|
||||
import CopyButton from "layout/CopyButton.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
import { loading_finish, loading_start } from "lib/Loading";
|
||||
|
||||
let dispatch = createEventDispatcher()
|
||||
|
||||
let { nav, children }: {
|
||||
nav: FSNavigator;
|
||||
let {
|
||||
node,
|
||||
children
|
||||
}: {
|
||||
node: FSNode;
|
||||
children?: import('svelte').Snippet;
|
||||
} = $props();
|
||||
|
||||
@@ -36,7 +35,7 @@ let status = $state("loading")
|
||||
export const update = async () => {
|
||||
try {
|
||||
loading_start()
|
||||
let resp = await fetch(fs_path_url(nav.base.path)+"?torrent_info")
|
||||
let resp = await fetch(fs_path_url(node.path)+"?torrent_info")
|
||||
|
||||
if (resp.status >= 400) {
|
||||
let json = await resp.json()
|
||||
@@ -73,9 +72,9 @@ let magnet = $state("")
|
||||
|
||||
{@render children?.()}
|
||||
|
||||
<h1>{$nav.base.name}</h1>
|
||||
<h1>{node.name}</h1>
|
||||
|
||||
<IconBlock icon_href={fs_node_icon($nav.base, 256, 256)}>
|
||||
<IconBlock icon_href={fs_node_icon(node, 256, 256)}>
|
||||
{#if status === "finished"}
|
||||
Created by: {torrent.created_by}<br/>
|
||||
Comment: {torrent.comment}<br/>
|
||||
@@ -96,7 +95,7 @@ let magnet = $state("")
|
||||
Torrent file could not be parsed. It may be corrupted.
|
||||
</p>
|
||||
{/if}
|
||||
<button onclick={() => {dispatch("download")}} class="button">
|
||||
<button onclick={() => node.download()} class="button">
|
||||
<i class="icon">download</i>
|
||||
<span>Download torrent file</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user