chore: formatting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kieran 2023-11-27 20:03:47 +00:00
parent faef2b5969
commit 60646daa8c
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 9 additions and 3 deletions

View File

@ -31,7 +31,10 @@ export function TorrentList({ items }: { items: Array<TaggedNostrEvent> }) {
function TorrentTableEntry({ item }: { item: TaggedNostrEvent }) {
const profile = useUserProfile(item.pubkey);
const name = item.tags.find((a) => a[0] === "title")?.at(1);
const size = item.tags.filter(a => a[0] === "file").map(a => Number(a[2])).reduce((acc, v) => acc += v, 0);
const size = item.tags
.filter((a) => a[0] === "file")
.map((a) => Number(a[2]))
.reduce((acc, v) => (acc += v), 0);
const npub = hexToBech32("npub", item.pubkey);
return (
<tr>

View File

@ -29,7 +29,10 @@ export function TorrentDetail({ item }: { item: TaggedNostrEvent }) {
const login = useLogin();
const navigate = useNavigate();
const name = item.tags.find((a) => a[0] === "title")?.at(1);
const size = item.tags.filter(a => a[0] === "file").map(a => Number(a[2])).reduce((acc, v) => acc += v, 0);
const size = item.tags
.filter((a) => a[0] === "file")
.map((a) => Number(a[2]))
.reduce((acc, v) => (acc += v), 0);
const files = item.tags.filter((a) => a[0] === "file");
const tags = item.tags.filter((a) => a[0] === "t").map((a) => a[1]);