Files
opencode/packages/app/src/utils/notification-click.ts

13 lines
259 B
TypeScript

type WindowTarget = {
focus: () => void
location: {
assign: (href: string) => void
}
}
export const handleNotificationClick = (href?: string, target: WindowTarget = window) => {
target.focus()
if (!href) return
target.location.assign(href)
}