app: prefer using useLocation instead of window.location (#15989)
This commit is contained in:
parent
f363904feb
commit
7948de1612
8 changed files with 50 additions and 44 deletions
|
|
@ -7,6 +7,7 @@ export const setNavigate = (fn: (href: string) => void) => {
|
|||
export const handleNotificationClick = (href?: string) => {
|
||||
window.focus()
|
||||
if (!href) return
|
||||
if (nav) nav(href)
|
||||
else window.location.assign(href)
|
||||
if (nav) return nav(href)
|
||||
console.warn("notification-click: navigate function not set, falling back to window.location.assign")
|
||||
window.location.assign(href)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue