fix: implement UUID generation utility and replace crypto.randomUUID usage (to support genertaion when we are in http )in task and chore components

This commit is contained in:
Mo Tarbin
2026-07-09 14:44:05 -04:00
parent 7889c32be0
commit d207f7e2b2
5 changed files with 251 additions and 135 deletions

10
src/utils/UUID.js Normal file
View File

@@ -0,0 +1,10 @@
export function generateUUID() {
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
return crypto.randomUUID()
}
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0
const v = c === 'x' ? r : (r & 0x3) | 0x8
return v.toString(16)
})
}