Skip to content

Commit b277230

Browse files
committed
try patching reload loops
1 parent f44e877 commit b277230

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

app/item/[tag]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ const ItemFAQ = dynamic(() => import('../../../components/ItemFAQ/ItemFAQ'), {
2626
loading: () => <div style={{ minHeight: '200px' }}>Loading...</div>
2727
})
2828

29-
// Revalidate every 60 seconds for price data freshness
30-
export const revalidate = 60
29+
// Revalidate every 600 seconds (10 minutes) for price data freshness
30+
// Note: Shorter revalidation times can cause hydration mismatches in some cases
31+
export const revalidate = 600
3132

3233
// Enable static params optimization for popular items
3334
export const dynamicParams = true
@@ -78,7 +79,7 @@ export default async function Page(props) {
7879
range={data.range}
7980
prices={data.prices}
8081
isBazaar={isBazaar}
81-
itemFlags={data.itemFlags}
82+
itemFlags={data.itemFlags || null}
8283
/>
8384
</Container>
8485
<NitroAdSlot

components/ItemFAQ/ItemFAQ.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ export default function ItemFAQ({ item, tag, range, prices, isBazaar, itemFlags
121121
const trend = computeTrend(values)
122122
const hasHistory = Array.isArray(prices) && prices.length > 0 && range !== 'active'
123123

124-
const lastUpdated = new Date().toLocaleString()
125-
126124
const isMuseum = itemFlags?.isMuseum ?? false
127125
const isCraftable = itemFlags?.isCraftable ?? false
128126
const isFireSale = itemFlags?.isFireSale ?? false
@@ -180,10 +178,6 @@ export default function ItemFAQ({ item, tag, range, prices, isBazaar, itemFlags
180178
? `Yes! ${itemName} can be sold on the Auction House.`
181179
: `${itemName} is not tradeable on the Auction House and not sellable on the SkyBlock Bazaar.`
182180
},
183-
{
184-
q: `When was this data last updated?`,
185-
a: `This FAQ was last updated at ${lastUpdated}.`
186-
},
187181
{
188182
q: `How to flip ${itemName}?`,
189183
a: isBazaar ? (

utils/ItemsCache.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ export function parseFlags(flags: ItemFlags | string | number | undefined | null
141141
* Returns null if item not found in cache
142142
*/
143143
export async function getCachedItemInfo(tag: string): Promise<CachedItemInfo | null> {
144-
const itemsRecord = await getCachedItems()
145-
return itemsRecord[tag] || null
144+
try {
145+
const itemsRecord = await getCachedItems()
146+
return itemsRecord[tag] || null
147+
} catch (error) {
148+
console.error('Error getting cached item info:', error)
149+
return null
150+
}
146151
}
147152

148153
/**

0 commit comments

Comments
 (0)