From f3cb220711c7848b782f1af940ddeb1567db74bb Mon Sep 17 00:00:00 2001 From: evanpelle Date: Wed, 18 Dec 2024 07:54:54 -0800 Subject: [PATCH] don't use crypto.randomUUID() because older browsers may not support it --- src/client/index.html | 2 +- src/core/worker/WorkerClient.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/index.html b/src/client/index.html index b157c3274..9deb9763d 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -28,7 +28,7 @@

OpenFront.io

-

(v0.12.5)

+

(v0.12.6)


diff --git a/src/core/worker/WorkerClient.ts b/src/core/worker/WorkerClient.ts index 99dfbb858..3db8c7a36 100644 --- a/src/core/worker/WorkerClient.ts +++ b/src/core/worker/WorkerClient.ts @@ -1,6 +1,7 @@ import { Cell, Game, GameMap, TerrainTile, TerrainType, Tile } from "../game/Game"; import { AStar, PathFindResultType } from "../pathfinding/AStar"; import { MiniAStar } from "../pathfinding/MiniAStar"; +import { generateID } from "../Util"; export class WorkerClient { @@ -61,7 +62,7 @@ export class ParallelAStar implements AStar { ) { } findPath(): Promise { - const requestId = crypto.randomUUID(); + const requestId = generateID() this.promise = new Promise((resolve, reject) => { const handler = (e: MessageEvent) => {