fix(app): notification should navigate to session
This commit is contained in:
12
packages/app/src/utils/notification-click.ts
Normal file
12
packages/app/src/utils/notification-click.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user