mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-09 00:09:55 +00:00
Hotfix: Replace calls to crypto.randomUUID (#82)
`crypto.randomUUID` is only available in secure contexts (HTTPS), which throws an error when trying to run in certain situations/browsers.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { type AbstractCtor, type Ctor, type Fn } from "@storyteller/utility";
|
||||
import { type PropertyValues } from "lit";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
export class UniqueToken {
|
||||
get id() { return this.#id; }
|
||||
@@ -10,7 +11,7 @@ export class UniqueToken {
|
||||
}
|
||||
|
||||
static create<T>(name?: string): Token<T> {
|
||||
return new UniqueToken(name ?? crypto.randomUUID());
|
||||
return new UniqueToken(name ?? uuid());
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
|
||||
Reference in New Issue
Block a user