-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MAPS-748 autocomplete sessions into javascript sdk #141
base: master
Are you sure you want to change the base?
Conversation
src/ui/autocomplete.ts
Outdated
@@ -511,6 +548,10 @@ class AutocompleteUI { | |||
return this; | |||
} | |||
|
|||
public generateUUID = (): string => { | |||
return crypto.randomUUID(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to use crypto.randomUUID() but not sure if this is the case but maybe:
@@ -442,6 +457,28 @@ class AutocompleteUI { | |||
onSelection(result); | |||
} | |||
|
|||
// Radar Autocomplete Session | |||
if (this.session) { | |||
const userId = Storage.getItem(Storage.USER_ID) || undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I'm still including these even though right now we don't use them, but in case we wanted to store them in the future so we don't have to update the sdk twice
Adding autocomplete sessions in Radar's JavaScript SDK
Demo:
https://frontend-git-boon-radar-autocomplete-demo-radarlabs.vercel.app/dashboard/maps/maps-explorer/autocomplete?live=true&project=63bd823ce0e5fb0060b7cb49