mirror of
https://github.com/xxnuo/MTranServer.git
synced 2026-09-03 06:35:20 +08:00
Update TranslationPanel.tsx
This commit is contained in:
@@ -54,6 +54,7 @@ export function TranslationPanel({
|
||||
const [translatedText, setTranslatedText] = useState('')
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [autoTranslate, setAutoTranslate] = useState(() => localStorage.getItem(storageKey('autoTranslate')) === 'true')
|
||||
const firstTranslateTipKey = 'firstTranslateTipShown'
|
||||
|
||||
const translateTimeoutRef = useRef<number | null>(null)
|
||||
|
||||
@@ -102,6 +103,11 @@ export function TranslationPanel({
|
||||
return
|
||||
}
|
||||
|
||||
if (localStorage.getItem(firstTranslateTipKey) !== 'true') {
|
||||
localStorage.setItem(firstTranslateTipKey, 'true')
|
||||
toast(t('firstTranslationTip'), { position: 'bottom-right' })
|
||||
}
|
||||
|
||||
setLoading(true)
|
||||
setTranslatedText('')
|
||||
|
||||
@@ -479,4 +485,4 @@ export function TranslationPanel({
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user