diff options
| author | Adam <[email protected]> | 2026-02-12 20:04:19 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-02-12 20:04:36 -0600 |
| commit | c9719dff7223aa1fc19540f3cd627c7f40e4bf36 (patch) | |
| tree | 05032d15edce5b5c0d2cecd0e919b4365b531329 /packages/app/src/utils/notification-click.ts | |
| parent | 7f95cc64c57b439f58833d0300a1da93b3b893df (diff) | |
| download | opencode-c9719dff7223aa1fc19540f3cd627c7f40e4bf36.tar.gz opencode-c9719dff7223aa1fc19540f3cd627c7f40e4bf36.zip | |
fix(app): notification should navigate to session
Diffstat (limited to 'packages/app/src/utils/notification-click.ts')
| -rw-r--r-- | packages/app/src/utils/notification-click.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/app/src/utils/notification-click.ts b/packages/app/src/utils/notification-click.ts new file mode 100644 index 000000000..1234cd1d6 --- /dev/null +++ b/packages/app/src/utils/notification-click.ts @@ -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) +} |
