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
commit 7948de1612
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 50 additions and 44 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)
}