mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 03:09:50 +08:00
fix(codex): 避免重置机会缺失触发配额刷新
This commit is contained in:
-16
@@ -7,7 +7,6 @@ import {
|
||||
getCodexResetCreditAvailableCount,
|
||||
getVisibleCodexResetCreditItems,
|
||||
mergeCodexQuotaDisplays,
|
||||
shouldRefreshMissingCodexResetCredits,
|
||||
} from '@/features/providers/components/codex-reset-credit-display'
|
||||
import type { QuotaResetCreditsSnapshot } from '@/api/endpoints/types'
|
||||
|
||||
@@ -60,21 +59,6 @@ describe('codex reset credit display helpers', () => {
|
||||
expect(getVisibleCodexResetCreditItems(snapshot, 1_700_000_000)).toEqual([])
|
||||
})
|
||||
|
||||
it('retries missing reset credits only when the cached detail check is stale', () => {
|
||||
expect(shouldRefreshMissingCodexResetCredits(null, 1_700_000_000)).toBe(true)
|
||||
expect(shouldRefreshMissingCodexResetCredits({
|
||||
detail_status: 'failed',
|
||||
updated_at: 1_699_999_900,
|
||||
}, 1_700_000_000)).toBe(false)
|
||||
expect(shouldRefreshMissingCodexResetCredits({
|
||||
detail_status: 'failed',
|
||||
updated_at: 1_699_999_600,
|
||||
}, 1_700_000_000)).toBe(true)
|
||||
expect(shouldRefreshMissingCodexResetCredits({
|
||||
available_count: 0,
|
||||
}, 1_700_000_000)).toBe(false)
|
||||
})
|
||||
|
||||
it('sorts available detail items by remaining time and labels visible items with short ordinal keys', () => {
|
||||
const snapshot: QuotaResetCreditsSnapshot = {
|
||||
available_count: 7,
|
||||
|
||||
Reference in New Issue
Block a user