mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 14:52:25 +00:00
14 lines
384 B
TypeScript
14 lines
384 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) return nav(href)
|
|
console.warn("notification-click: navigate function not set, falling back to window.location.assign")
|
|
window.location.assign(href)
|
|
}
|