mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
* fix codex session import merge (#1123) 修复 Codex 会话导入合并后列表为空的问题。 Fix Codex session import merge so a session is not detected as a duplicate of itself and deleted during merge. Co-authored-by: LIUZHIRU <ryuu@fine-net.co.jp> * fix(web): keep overlays below PWA status bar Account for env(safe-area-inset-top) on fixed top banners, image preview chrome, and session action menus so installed PWA mode no longer draws controls under the OS status bar. Fixes #1066 --------- Co-authored-by: Himehane <36065996+Himehane@users.noreply.github.com> Co-authored-by: LIUZHIRU <ryuu@fine-net.co.jp>
29 lines
819 B
TypeScript
29 lines
819 B
TypeScript
import { useEffect } from 'react'
|
|
import { useVoiceOptional } from '@/lib/voice-context'
|
|
|
|
export function VoiceErrorBanner() {
|
|
const voice = useVoiceOptional()
|
|
|
|
const shouldShow = voice && voice.status === 'error' && voice.errorMessage
|
|
|
|
useEffect(() => {
|
|
if (!shouldShow || !voice) return
|
|
|
|
const timer = setTimeout(() => {
|
|
voice.setStatus('disconnected')
|
|
}, 3000)
|
|
|
|
return () => clearTimeout(timer)
|
|
}, [shouldShow, voice])
|
|
|
|
if (!shouldShow) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<div className="fixed top-0 left-0 right-0 bg-red-500 text-white text-center pb-2 pt-[calc(env(safe-area-inset-top)+0.5rem)] text-sm font-medium z-50 flex items-center justify-center border-b border-red-600">
|
|
{voice.errorMessage}
|
|
</div>
|
|
)
|
|
}
|