refactor(web): migrate core toast call sites to base ui toast (#33643)

This commit is contained in:
yyh
2026-03-18 16:53:55 +08:00
committed by GitHub
parent db4deb1d6b
commit 93f9546353
29 changed files with 353 additions and 480 deletions

View File

@ -5,7 +5,7 @@ import { useQueryClient } from '@tanstack/react-query'
import dayjs from 'dayjs'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Toast from '@/app/components/base/toast'
import { toast } from '@/app/components/base/ui/toast'
import { setZendeskConversationFields } from '@/app/components/base/zendesk/utils'
import { defaultPlan } from '@/app/components/billing/config'
import { parseCurrentPlan } from '@/app/components/billing/utils'
@ -132,13 +132,11 @@ export const ProviderContextProvider = ({
if (anthropic && anthropic.system_configuration.current_quota_type === CurrentSystemQuotaTypeEnum.trial) {
const quota = anthropic.system_configuration.quota_configurations.find(item => item.quota_type === anthropic.system_configuration.current_quota_type)
if (quota && quota.is_valid && quota.quota_used < quota.quota_limit) {
Toast.notify({
localStorage.setItem('anthropic_quota_notice', 'true')
toast.add({
type: 'info',
message: t('provider.anthropicHosted.trialQuotaTip', { ns: 'common' }),
duration: 60000,
onClose: () => {
localStorage.setItem('anthropic_quota_notice', 'true')
},
title: t('provider.anthropicHosted.trialQuotaTip', { ns: 'common' }),
timeout: 60000,
})
}
}