From 720e7309611f26142cb57266e2f3b5463606ad11 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Fri, 7 Feb 2025 16:30:39 -0500 Subject: [PATCH] refactor: suppress math.random issues Signed-off-by: Adam Setch --- src/renderer/components/AllRead.tsx | 1 + src/renderer/components/Oops.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/renderer/components/AllRead.tsx b/src/renderer/components/AllRead.tsx index 4109d4d33..6134b59d0 100644 --- a/src/renderer/components/AllRead.tsx +++ b/src/renderer/components/AllRead.tsx @@ -17,6 +17,7 @@ export const AllRead: FC = ({ fullHeight = true }: IAllRead) => { const emoji = useMemo( () => Constants.ALL_READ_EMOJIS[ + // NOSONAR: Non-secure PRNG is acceptable here Math.floor(Math.random() * Constants.ALL_READ_EMOJIS.length) ], [], diff --git a/src/renderer/components/Oops.tsx b/src/renderer/components/Oops.tsx index c6352b3da..b996d337c 100644 --- a/src/renderer/components/Oops.tsx +++ b/src/renderer/components/Oops.tsx @@ -13,6 +13,7 @@ export const Oops: FC = ({ error, fullHeight = true }: IOops) => { const err = error ?? Errors.UNKNOWN; const emoji = useMemo( + // NOSONAR: Non-secure PRNG is acceptable here () => err.emojis[Math.floor(Math.random() * err.emojis.length)], [err], );