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:
Danny McGee
2024-03-08 19:56:19 -05:00
committed by GitHub
parent 33250e4627
commit 9dfbcae134
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import { customElement, state } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { createRef, ref } from "lit/directives/ref.js";
import { styleMap } from "lit/directives/style-map.js";
import { v4 as uuid } from "uuid";
import { ImageInfo, LcmClient } from "./lcm-client";
@@ -38,7 +39,7 @@ export class AppElement extends LitElement {
@state() inputUrl?: string;
@state() outputUrl?: string;
#lcmClient = new LcmClient(crypto.randomUUID());
#lcmClient = new LcmClient(uuid());
#outputImageRef = createRef<HTMLImageElement>();
constructor () {