Skip to content

Commit f20a910

Browse files
authored
🐛 fix(TokenUsage): prevent animation when toggling between token and credit display (lobehub#10098)
1 parent e56e50b commit f20a910

File tree

1 file changed

+3
-0
lines changed
  • src/features/Conversation/components/Extras/Usage/UsageDetail

1 file changed

+3
-0
lines changed

src/features/Conversation/components/Extras/Usage/UsageDetail/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ const TokenDetail = memo<TokenDetailProps>(({ meta, model, provider }) => {
217217
<Icon icon={isShowCredit ? BadgeCent : CoinsIcon} />
218218
<AnimatedNumber
219219
formatter={(value) => (formatShortenNumber(value) as string).toLowerCase?.()}
220+
// Force remount when switching between token/credit to prevent unwanted animation
221+
// See: https://github.com/lobehub/lobe-chat/pull/10098
222+
key={isShowCredit ? 'credit' : 'token'}
220223
value={totalCount}
221224
/>
222225
</Center>

0 commit comments

Comments
 (0)