Skip to content

Commit

Permalink
remove client.set of user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-astra-via committed May 28, 2024
1 parent f38cc74 commit 4d55563
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ import UAParser from 'ua-parser-js'

// Get the user ID stored in the client, if it does not exist, then do not set it.
const getUserId = (event: MCEvent): string | null => {
const { client } = event
const userId = event.payload.user_id || client.get('user_id')
const userId = event.payload.user_id
if (!userId) {
return null
}
if (event.payload.user_id) {
client.set('user_id', userId, { scope: 'infinite' })
}
return userId
}

Expand Down

0 comments on commit 4d55563

Please sign in to comment.