fix(app): notification should navigate to session
This commit is contained in:
parent
7f95cc64c5
commit
c9719dff72
5 changed files with 50 additions and 10 deletions
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue