mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 20:03:13 +08:00
35 lines
988 B
TypeScript
35 lines
988 B
TypeScript
import { AppShell } from './components/layout/AppShell'
|
|
import { useScheduledTaskDesktopNotifications } from './hooks/useScheduledTaskDesktopNotifications'
|
|
import { installDesktopNotificationNavigation } from './lib/desktopNotificationNavigation'
|
|
import { useEffect } from 'react'
|
|
import { RemoteAccessGate } from './pages/RemoteAccess'
|
|
import { isPublicAccessRuntime } from './lib/publicAccessRuntime'
|
|
|
|
export function App() {
|
|
return isPublicAccessRuntime()
|
|
? <RemoteAccessGate><ConnectedApp /></RemoteAccessGate>
|
|
: <ConnectedApp />
|
|
}
|
|
|
|
function ConnectedApp() {
|
|
useScheduledTaskDesktopNotifications()
|
|
useEffect(() => {
|
|
let cleanup: (() => void) | undefined
|
|
let cancelled = false
|
|
installDesktopNotificationNavigation()
|
|
.then((fn) => {
|
|
if (cancelled) {
|
|
fn()
|
|
} else {
|
|
cleanup = fn
|
|
}
|
|
})
|
|
.catch(() => {})
|
|
return () => {
|
|
cancelled = true
|
|
cleanup?.()
|
|
}
|
|
}, [])
|
|
return <AppShell />
|
|
}
|