Skip to content

Commit

Permalink
Usersnap roles test
Browse files Browse the repository at this point in the history
  • Loading branch information
ikprk committed May 23, 2024
1 parent 92d67b5 commit 23a9802
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/atlas/src/providers/user/user.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ export const UserProvider: FC<PropsWithChildren> = ({ children }) => {
memberId: currentUser?.membershipId,
channelId: currentMemberships?.[0].channels[0]?.id,
}
const hasCreatedSingleVideo = currentMemberships?.[0]?.channels.some((channel) => channel.totalVideosCreated > 0)

SentryLogger.setUser(user)
UserEventsLogger.setUser(user)
// @ts-ignore custom prop required by usersnap
window.Usersnap?.init({
...user,
role: hasCreatedSingleVideo ? 'creator' : 'default',
})
}, [
currentMemberships,
currentUser?.email,
Expand Down

0 comments on commit 23a9802

Please sign in to comment.