diff options
| author | Brendan Allan <[email protected]> | 2026-03-05 14:41:12 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-05 14:41:12 +0800 |
| commit | 7948de16129970ab01286fbbd7ba7a5e5dcf7be9 (patch) | |
| tree | 936873d4f5048a7665ad4fcf9e21e404f1a8ea23 /packages/app/src/utils | |
| parent | f363904febd2134e8c73681e1b02cfb283e075a2 (diff) | |
| download | opencode-7948de16129970ab01286fbbd7ba7a5e5dcf7be9.tar.gz opencode-7948de16129970ab01286fbbd7ba7a5e5dcf7be9.zip | |
app: prefer using useLocation instead of window.location (#15989)
Diffstat (limited to 'packages/app/src/utils')
| -rw-r--r-- | packages/app/src/utils/notification-click.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/app/src/utils/notification-click.ts b/packages/app/src/utils/notification-click.ts index 94086c595..316b27820 100644 --- a/packages/app/src/utils/notification-click.ts +++ b/packages/app/src/utils/notification-click.ts @@ -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) } |
