KOL count: 29 → 25 across marketing/SEO copy
Backend KOL_FEEDS trimmed from 29 to 25 (dead feeds removed).
Sync all hardcoded count mentions:
- layout.tsx JSON-LD, page.tsx (metric + comparison + copy)
- kol/page.tsx, KolPageClient.tsx ("and 26 more" → "and 22 more")
- glossary/page.tsx, opengraph-image.tsx
- public/llms.txt, llms-full.txt
- drop removed KOLs (Dragonfly Capital, Nic Carter) from named lists
Bundles other in-flight frontend work already in the working tree.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
import { useState, useEffect, useCallback, useRef } from 'react'
|
||||
import { useLocale } from 'next-intl'
|
||||
import { useAccount, useSignMessage } from 'wagmi'
|
||||
import {
|
||||
@@ -36,19 +36,36 @@ export default function TelegramCard() {
|
||||
|
||||
useEffect(() => { setMounted(true) }, [])
|
||||
|
||||
// Generation counter guards against stale-closure trap: `snap !== address`
|
||||
// inside useCallback compares two closed-over copies of the same value and
|
||||
// is always false. genRef is a mutable ref readable from any closure.
|
||||
const genRef = useRef(0)
|
||||
useEffect(() => { genRef.current++ }, [address])
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
if (!address) {
|
||||
setLoading(false)
|
||||
setStatus(null)
|
||||
return
|
||||
}
|
||||
if (!address) { setLoading(false); setStatus(null); return }
|
||||
const gen = genRef.current
|
||||
setLoading(true)
|
||||
try {
|
||||
const s = await getTelegramStatus(address.toLowerCase())
|
||||
const { getCachedViewEnvelope } = await import('@/lib/signedRequest')
|
||||
const cached = getCachedViewEnvelope('view_user', address)
|
||||
const s = await getTelegramStatus(address.toLowerCase(), cached ?? undefined)
|
||||
if (gen !== genRef.current) return // wallet changed while in-flight
|
||||
setStatus(s); setErr('')
|
||||
} catch (e) {
|
||||
if (gen !== genRef.current) return
|
||||
setErr(e instanceof Error ? e.message : 'load failed')
|
||||
} finally { setLoading(false) }
|
||||
} finally {
|
||||
if (gen === genRef.current) setLoading(false)
|
||||
}
|
||||
}, [address])
|
||||
|
||||
// B32: clear stale status immediately when wallet changes so the previous
|
||||
// wallet's binding info never flickers in before the new fetch resolves.
|
||||
useEffect(() => {
|
||||
setStatus(null)
|
||||
setCode(null)
|
||||
setErr('')
|
||||
}, [address])
|
||||
|
||||
useEffect(() => { refresh() }, [refresh])
|
||||
@@ -112,7 +129,7 @@ export default function TelegramCard() {
|
||||
Telegram alerts
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--ink-3)', lineHeight: 1.6 }}>
|
||||
Connect your wallet first. After that, you can link Telegram for alert delivery and Pro wallet-bound notifications.
|
||||
You can get free Telegram alerts without a wallet — just open the bot. Connect a wallet here to also get alerts tailored to your own positions.
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@@ -180,8 +197,8 @@ export default function TelegramCard() {
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--ink-4)', marginTop: 2 }}>
|
||||
{status.bound
|
||||
? (isZh ? '打开机器人调整偏好(/trump /btc /funding /kol /conf /quiet)' : 'Open the bot to adjust preferences (/trump /btc /funding /kol /conf /quiet)')
|
||||
: (isZh ? '打开机器人并发送 /start,无需额外账号' : 'Open the bot and send /start — no account needed')}
|
||||
? (isZh ? '在机器人里可开关各类提醒、设置免打扰时段' : 'Open the bot to choose which alerts you get and set quiet hours')
|
||||
: (isZh ? '打开机器人并发送 /start,无需额外账号' : 'Open the bot and tap Start — no account needed')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -197,11 +214,11 @@ export default function TelegramCard() {
|
||||
</span>
|
||||
{status.wallet_address ? (
|
||||
<>
|
||||
<span style={{ color: 'var(--ink-5)' }}>·</span>
|
||||
<span style={{ color: 'var(--ink-4)' }}>·</span>
|
||||
<span style={{ color: 'var(--up)', fontSize: 11 }}>Pro</span>
|
||||
<span style={{ color: 'var(--ink-5)' }}>·</span>
|
||||
<span style={{ color: 'var(--ink-4)' }}>·</span>
|
||||
<span>{isZh ? `已发送 ${status.total_alerts_sent ?? 0} 条提醒` : `${status.total_alerts_sent ?? 0} alerts sent`}</span>
|
||||
<span style={{ color: 'var(--ink-5)' }}>·</span>
|
||||
<span style={{ color: 'var(--ink-4)' }}>·</span>
|
||||
<button className="btn ghost" disabled={busy} onClick={handleUnbind}
|
||||
style={{ fontSize: 11, color: 'var(--down)', padding: '2px 8px' }}>
|
||||
{isZh ? '断开钱包绑定' : 'Disconnect wallet'}
|
||||
@@ -209,7 +226,7 @@ export default function TelegramCard() {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<span style={{ color: 'var(--ink-5)' }}>·</span>
|
||||
<span style={{ color: 'var(--ink-4)' }}>·</span>
|
||||
<span>{isZh ? `已发送 ${status.total_alerts_sent ?? 0} 条提醒` : `${status.total_alerts_sent ?? 0} alerts sent`}</span>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user