@@ -48,6 +48,7 @@ import {
48
48
getHolders ,
49
49
isAddressFiltered ,
50
50
isTorchBurned ,
51
+ TorchHolder ,
51
52
} from "@/lib/torch"
52
53
import TenYearLogo from "@/public/images/10-year-anniversary/10-year-logo.png"
53
54
@@ -101,13 +102,19 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
101
102
{ } as Record < string , ( typeof allTorchHolders ) [ 0 ] >
102
103
)
103
104
104
- const isBurned = await isTorchBurned ( )
105
- const currentHolderAddress = await getCurrentHolderAddress ( )
106
- const isFiltered = isAddressFiltered ( currentHolderAddress )
107
-
108
- const currentHolder = isFiltered
109
- ? null
110
- : torchHolderMap [ currentHolderAddress . toLowerCase ( ) ]
105
+ let isBurned = false
106
+ let currentHolder : TorchHolder | null = null
107
+ try {
108
+ isBurned = await isTorchBurned ( )
109
+ const currentHolderAddress = await getCurrentHolderAddress ( )
110
+ const isFiltered = isAddressFiltered ( currentHolderAddress )
111
+
112
+ currentHolder = isFiltered
113
+ ? null
114
+ : torchHolderMap [ currentHolderAddress . toLowerCase ( ) ]
115
+ } catch ( error ) {
116
+ console . error ( "Error fetching torch data:" , error )
117
+ }
111
118
const torchHolders = await getHolders ( torchHolderMap )
112
119
113
120
return (
@@ -306,7 +313,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
306
313
307
314
< TorchHistorySwiper
308
315
holders = { torchHolders }
309
- currentHolderAddress = { currentHolderAddress }
316
+ currentHolderAddress = { currentHolder ?. address || null }
310
317
/>
311
318
312
319
< div className = "flex flex-col gap-12 px-16 pb-24 pt-12 text-body-inverse md:flex-row dark:text-body" >
0 commit comments