File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
apps/app/src/components/notifications Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11'use client' ;
22
3+ import { usePathname } from 'next/navigation' ;
34import { env } from '@/env.mjs' ;
45import { Inbox } from '@novu/nextjs' ;
56import { useSession } from '@/utils/auth-client' ;
@@ -8,15 +9,18 @@ export function NotificationBell() {
89 const applicationIdentifier = env . NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER ;
910 const { data : session } = useSession ( ) ;
1011 const sessionData = session ?. session ;
12+ const pathname = usePathname ( ) ;
13+ const orgId = pathname ?. split ( '/' ) [ 1 ] || null ;
14+
1115 // Don't render if we don't have the required config
12- if ( ! applicationIdentifier || ! sessionData ?. userId || ! sessionData ?. activeOrganizationId ) {
16+ if ( ! applicationIdentifier || ! sessionData ?. userId || ! orgId ) {
1317 return null ;
1418 }
1519
1620 return (
1721 < Inbox
1822 applicationIdentifier = { applicationIdentifier }
19- subscriber = { `${ sessionData . userId } -${ sessionData . activeOrganizationId } ` }
23+ subscriber = { `${ sessionData . userId } -${ orgId } ` }
2024 appearance = { {
2125 elements : {
2226 popoverContent : {
You can’t perform that action at this time.
0 commit comments