Skip to content

Commit

Permalink
fix: uuid regression (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
chloe-renaud authored Jan 8, 2025
1 parent 2a250c6 commit fd29281
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ export function nestedStoreToFlat(
return storeToArray(joinedItems);
}

/** Generate a random uuid of 36 characters. */
/**
* Generate a uid of 8 characters from current date and random number
* in base 36 (e.g. "m5noru0h").
*
* We cannot use a true uuid for now because of back-end limitations.
*/
export function uuid() {
return self.crypto.randomUUID();
return (+new Date() + Math.floor(Math.random() * 999999)).toString(36);
}

/** A label is made of 10 uppercased alphanumeric characters. */
Expand Down

0 comments on commit fd29281

Please sign in to comment.