app: prefer using useLocation instead of window.location (#15989)

This commit is contained in:
Brendan Allan
2026-03-05 14:41:12 +08:00
committed by GitHub
parent f363904feb
commit 7948de1612
8 changed files with 49 additions and 43 deletions

View File

@@ -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)
}