From 0327fb2c237b9e461990c8c42a06884e4ec37487 Mon Sep 17 00:00:00 2001 From: colton <1679963578@qq.com> Date: Fri, 9 Aug 2024 15:07:02 +0800 Subject: [PATCH] feat:Add file name to downloaded file --- src/components/ATable.tsx | 4 ++-- src/pages/files.tsx | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/ATable.tsx b/src/components/ATable.tsx index ebc3928..c6a8fa3 100644 --- a/src/components/ATable.tsx +++ b/src/components/ATable.tsx @@ -12,7 +12,7 @@ const ATable: FC = ({ header = [], data = [], loading }) => { const onDownloadFile = (item: data) => { - const host = ` https://ton-gateway.crust.network/gateway/${item.bagId}` + const host = ` https://ton-gateway.crust.network/gateway/${item.bagId}?filename=${item.fileName}` const link = document.createElement("a"); link.href = host; link.click(); @@ -32,7 +32,7 @@ const ATable: FC = ({ header = [], data = [], loading }) => { loading ? : data.length > 0 && data.map((item, i) => { return -
{truncateMiddle(item.fileName, 10, 10)}
+
{truncateMiddle(item.fileName, 5, 5)}
{truncateMiddle(item.bagId, 5, 5)}