From b3e57dae85a16f50deff69b93330f51b6908402e Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:20:52 +0300 Subject: [PATCH] Use crypto UUID for UI --- public/scripts/utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/scripts/utils.js b/public/scripts/utils.js index 30ede344d..b192dd9f1 100644 --- a/public/scripts/utils.js +++ b/public/scripts/utils.js @@ -1261,6 +1261,9 @@ export async function waitUntilCondition(condition, timeout = 1000, interval = 1 * uuidv4(); // '3e2fd9e1-0a7a-4f6d-9aaf-8a7a4babe7eb' */ export function uuidv4() { + if ('randomUUID' in crypto) { + 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);