Confirmed - no crypto usage found in the frontend. All references have been successfully removed ✓ (#1299)
This commit is contained in:
committed by
GitHub
parent
d683effcb9
commit
c9178de37e
@@ -11,6 +11,7 @@ import type {
|
|||||||
SelectedComponent,
|
SelectedComponent,
|
||||||
} from '@/utils/previewBridge';
|
} from '@/utils/previewBridge';
|
||||||
import type { TaskAttempt } from 'shared/types';
|
import type { TaskAttempt } from 'shared/types';
|
||||||
|
import { genId } from '@/utils/id';
|
||||||
|
|
||||||
export interface ClickedEntry {
|
export interface ClickedEntry {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -344,7 +345,7 @@ export function ClickedElementsProvider({
|
|||||||
return prev; // Skip consecutive duplicate
|
return prev; // Skip consecutive duplicate
|
||||||
}
|
}
|
||||||
const newEntry: ClickedEntry = {
|
const newEntry: ClickedEntry = {
|
||||||
id: crypto.randomUUID(),
|
id: genId(),
|
||||||
payload: sanitized,
|
payload: sanitized,
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
dedupeKey,
|
dedupeKey,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { SplitSide } from '@git-diff-view/react';
|
import { SplitSide } from '@git-diff-view/react';
|
||||||
import { createContext, useContext, useState, ReactNode } from 'react';
|
import { createContext, useContext, useState, ReactNode } from 'react';
|
||||||
|
import { genId } from '@/utils/id';
|
||||||
|
|
||||||
export interface ReviewComment {
|
export interface ReviewComment {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -46,7 +47,7 @@ export function ReviewProvider({ children }: { children: ReactNode }) {
|
|||||||
const addComment = (comment: Omit<ReviewComment, 'id'>) => {
|
const addComment = (comment: Omit<ReviewComment, 'id'>) => {
|
||||||
const newComment: ReviewComment = {
|
const newComment: ReviewComment = {
|
||||||
...comment,
|
...comment,
|
||||||
id: crypto.randomUUID(),
|
id: genId(),
|
||||||
};
|
};
|
||||||
setComments((prev) => [...prev, newComment]);
|
setComments((prev) => [...prev, newComment]);
|
||||||
};
|
};
|
||||||
|
|||||||
6
frontend/src/utils/id.ts
Normal file
6
frontend/src/utils/id.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
let seq = 0;
|
||||||
|
|
||||||
|
export function genId(): string {
|
||||||
|
seq = (seq + 1) & 0xffff;
|
||||||
|
return `${Date.now().toString(36)}-${seq.toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user