mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
Replace calls to crypto.randomUUID
This commit is contained in:
@@ -4,6 +4,7 @@ import { customElement, property } from "lit/decorators.js";
|
||||
import { ifDefined } from "lit/directives/if-defined.js";
|
||||
import { createRef, ref } from "lit/directives/ref.js";
|
||||
import { styleMap } from "lit/directives/style-map.js";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
import panelStyles from "./menu.element.scss?inline";
|
||||
|
||||
@@ -31,7 +32,7 @@ export class MenuElement extends LitElement {
|
||||
@inject(OVERLAY_PROVIDER)
|
||||
overlay!: OverlayProvider;
|
||||
|
||||
#menuId = crypto.randomUUID();
|
||||
#menuId = uuid();
|
||||
#slotRef = createRef<HTMLSlotElement>();
|
||||
#panelRef = createRef<MenuPanelElement>();
|
||||
#handle?: WeakRef<OverlayHandle>;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { match } from "@storyteller/utility";
|
||||
import axios, { AxiosResponse } from "axios";
|
||||
import { v4 as uuid } from "uuid";
|
||||
|
||||
export class StorytellerApi {
|
||||
#api = axios.create({
|
||||
@@ -11,7 +12,7 @@ export class StorytellerApi {
|
||||
const response = await this.#api.postForm<MediaUploadResponse>(
|
||||
"v1/engine/create_scene",
|
||||
{
|
||||
uuid_idempotency_token: crypto.randomUUID(),
|
||||
uuid_idempotency_token: uuid(),
|
||||
file,
|
||||
}, {
|
||||
headers: { Accept: "text/plain" },
|
||||
@@ -64,7 +65,7 @@ export class StorytellerApi {
|
||||
const response = await this.#api.postForm<MediaUploadResponse>(
|
||||
"v1/media_files/upload/engine_asset",
|
||||
{
|
||||
uuid_idempotency_token: crypto.randomUUID(),
|
||||
uuid_idempotency_token: uuid(),
|
||||
file,
|
||||
media_file_subtype: subtype,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user