Replace all crypto.randomUUID() calls with a uuid() utility that falls back to Math.random-based generation when the Web Crypto API is unavailable (plain HTTP contexts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
GPU_CONFIGS,
|
||||
FUNDING_ROUNDS,
|
||||
OPEN_SOURCE_REPUTATION_BOOST,
|
||||
uuid,
|
||||
} from '@ai-tycoon/shared';
|
||||
import { INITIAL_RIVALS } from '@ai-tycoon/game-engine';
|
||||
|
||||
@@ -105,7 +106,7 @@ export const useGameStore = create<Store>()(
|
||||
|
||||
addNotification: (n) => set((s) => ({
|
||||
notifications: [
|
||||
{ ...n, id: crypto.randomUUID(), read: false },
|
||||
{ ...n, id: uuid(), read: false },
|
||||
...s.notifications.slice(0, 49),
|
||||
],
|
||||
})),
|
||||
@@ -176,7 +177,7 @@ export const useGameStore = create<Store>()(
|
||||
if (s.economy.money < buildCost) return s;
|
||||
|
||||
const dc: DataCenter = {
|
||||
id: crypto.randomUUID(),
|
||||
id: uuid(),
|
||||
name,
|
||||
location,
|
||||
gpus: [],
|
||||
|
||||
Reference in New Issue
Block a user