mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-05 12:17:27 +00:00
13 lines
278 B
TypeScript
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)
|
|
}
|