diff --git a/frontend/src/components/torrent/details.rs b/frontend/src/components/torrent/details.rs
index ed754dd..45ee370 100644
--- a/frontend/src/components/torrent/details.rs
+++ b/frontend/src/components/torrent/details.rs
@@ -70,9 +70,27 @@ pub fn TorrentDetailsSheet() -> impl IntoView {
- }>
+
{move || {
- let t = selected_torrent.get().unwrap();
+ let t = selected_torrent.get().unwrap_or_else(|| shared::Torrent {
+ hash: "----------------------------------------".to_string(),
+ name: "Yükleniyor...".to_string(),
+ size: 0,
+ completed: 0,
+ down_rate: 0,
+ up_rate: 0,
+ eta: 0,
+ percent_complete: 0.0,
+ status: shared::TorrentStatus::Downloading,
+ error_message: "".to_string(),
+ added_date: 0,
+ label: None,
+ });
+
view! {
@@ -84,7 +102,7 @@ pub fn TorrentDetailsSheet() -> impl IntoView {
}
}}
-
+
@@ -129,30 +147,6 @@ fn InfoItem(
}
}
-#[component]
-fn DetailsShimmer() -> impl IntoView {
- view! {
-
-
- {(0..8).map(|_| view! {
-
- }).collect_view()}
-
-
-
-
- }
-}
-
fn format_bytes(bytes: i64) -> String {
const UNITS: [&str; 6] = ["B", "KB", "MB", "GB", "TB", "PB"];
if bytes < 1024 { return format!("{} B", bytes); }