Files
opencode/packages/app/src/utils/notification-click.ts
2026-03-04 15:12:34 +08:00

13 lines
278 B
TypeScript

let nav: ((href: string) => void) | undefined
export const setNavigate = (fn: (href: string) => void) => {
nav = fn
}
export const handleNotificationClick = (href?: string) => {
window.focus()
if (!href) return
if (nav) nav(href)
else window.location.assign(href)
}