File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed
Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,6 @@ import styles from './search.module.scss';
2222import { Logo } from '../logo' ;
2323import { NavLink } from '../navlink' ;
2424
25- // https://stackoverflow.com/a/2117523/115146
26- function uuidv4 ( ) {
27- let dt = new Date ( ) . getTime ( ) ;
28- const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' . replace ( / [ x y ] / g, function ( c ) {
29- const r = ( dt + Math . random ( ) * 16 ) % 16 | 0 ;
30- dt = Math . floor ( dt / 16 ) ;
31- return ( c === 'x' ? r : ( r & 0x3 ) | 0x8 ) . toString ( 16 ) ;
32- } ) ;
33- return uuid ;
34- }
35-
3625// Initialize Algolia Insights
3726algoliaInsights ( 'init' , {
3827 appId : process . env . NEXT_PUBLIC_ALGOLIA_APP_ID ,
@@ -42,7 +31,7 @@ algoliaInsights('init', {
4231// We dont want to track anyone cross page/sessions or use cookies
4332// so just generate a random token each time the page is loaded and
4433// treat it as a random user.
45- const randomUserToken = uuidv4 ( ) ;
34+ const randomUserToken = crypto . randomUUID ( ) ;
4635
4736const MAX_HITS = 10 ;
4837
You can’t perform that action at this time.
0 commit comments