Skip to content

Commit

Permalink
Fix/removed crypto random UUID with UUID (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardZaydler authored Apr 12, 2024
1 parent 1b54649 commit 28ebe93
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.10.2] 2024-04-11

### Fixes

* Fixed render targets with crypto Api ids in non-secure browser context (#504)

## [2.10.1] - 2024-04-05

### Fixes
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"react-virtualized-auto-sizer": "1.0.20",
"reflect-metadata": "0.1.13",
"remark-breaks": "4.0.0",
"start-server-and-test": "2.0.3"
"start-server-and-test": "2.0.3",
"uuid": "9.0.1"
},
"devDependencies": {
"@babel/core": "7.23.3",
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useIds.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState } from "react";
import { v4 as uuidv4 } from "uuid";

// Do not using crypto Api cause some opensource users may use Moira in non-secure browser context
export const useIds = (initialLength: number) => {
const [ids, setIds] = useState<string[]>(
Array.from({ length: initialLength }, () => crypto.randomUUID())
);
const [ids, setIds] = useState<string[]>(Array.from({ length: initialLength }, () => uuidv4()));

return [ids, setIds] as const;
};
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11626,6 +11626,11 @@ uuid@^9.0.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==

uuid@^9.0.1:
version "9.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==

uvu@^0.5.0:
version "0.5.6"
resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz"
Expand Down

0 comments on commit 28ebe93

Please sign in to comment.