From 6fa4e593c44066a0f1c12e46954a31ba20266b63 Mon Sep 17 00:00:00 2001 From: myung03 Date: Wed, 26 Jun 2024 17:28:47 -0700 Subject: [PATCH] fixed big int conversion error --- interface/app/$libraryId/overview/LibraryStats.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/interface/app/$libraryId/overview/LibraryStats.tsx b/interface/app/$libraryId/overview/LibraryStats.tsx index 57663a08a..38b4ec2ed 100644 --- a/interface/app/$libraryId/overview/LibraryStats.tsx +++ b/interface/app/$libraryId/overview/LibraryStats.tsx @@ -1,7 +1,13 @@ import { Info } from '@phosphor-icons/react'; import clsx from 'clsx'; import { useEffect, useState } from 'react'; -import { humanizeSize, Statistics, useLibraryContext, useLibraryQuery } from '@sd/client'; +import { + humanizeSize, + Statistics, + uint32ArrayToBigInt, + useLibraryContext, + useLibraryQuery +} from '@sd/client'; import { Card, Tooltip } from '@sd/ui'; import { useCounter, useIsDark, useLocale } from '~/hooks'; @@ -9,7 +15,7 @@ import StorageBar from './StorageBar'; interface StatItemProps { title: string; - bytes: bigint; + bytes: number; isLoading: boolean; info?: string; } @@ -121,7 +127,7 @@ const LibraryStats = () => { if (!acc[category]) { acc[category] = { total_bytes: 0 }; } - acc[category]!.total_bytes += curr.total_bytes[1]; + acc[category]!.total_bytes += Number(uint32ArrayToBigInt(curr.total_bytes)); return acc; }, {} as Record @@ -178,7 +184,7 @@ const LibraryStats = () => {