From a8b146df3e34aa38b4b203b549164d8ffa78abb1 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 1 Jul 2024 11:29:18 +0200 Subject: [PATCH] web: Move PanicError enum to its own file --- web/packages/core/src/internal/errors.tsx | 16 ++++++++++++++++ web/packages/core/src/internal/ui/panic.tsx | 18 +----------------- web/packages/core/src/ruffle-player.tsx | 3 ++- 3 files changed, 19 insertions(+), 18 deletions(-) create mode 100644 web/packages/core/src/internal/errors.tsx diff --git a/web/packages/core/src/internal/errors.tsx b/web/packages/core/src/internal/errors.tsx new file mode 100644 index 000000000..21921b108 --- /dev/null +++ b/web/packages/core/src/internal/errors.tsx @@ -0,0 +1,16 @@ +export enum PanicError { + Unknown, + CSPConflict, + FileProtocol, + InvalidWasm, + JavascriptConfiguration, + JavascriptConflict, + WasmCors, + WasmDownload, + WasmMimeType, + WasmNotFound, + WasmDisabledMicrosoftEdge, + InvalidSwf, + SwfFetchError, + SwfCors, +} diff --git a/web/packages/core/src/internal/ui/panic.tsx b/web/packages/core/src/internal/ui/panic.tsx index 8504d998b..d9cc3cdf7 100644 --- a/web/packages/core/src/internal/ui/panic.tsx +++ b/web/packages/core/src/internal/ui/panic.tsx @@ -2,23 +2,7 @@ import { text, textAsParagraphs } from "../../i18n"; import { createRef } from "tsx-dom"; import { buildInfo } from "../../build-info"; import { RUFFLE_ORIGIN } from "../constants"; - -export enum PanicError { - Unknown, - CSPConflict, - FileProtocol, - InvalidWasm, - JavascriptConfiguration, - JavascriptConflict, - WasmCors, - WasmDownload, - WasmMimeType, - WasmNotFound, - WasmDisabledMicrosoftEdge, - InvalidSwf, - SwfFetchError, - SwfCors, -} +import { PanicError } from "../errors"; interface PanicLink { type: "open_link"; diff --git a/web/packages/core/src/ruffle-player.tsx b/web/packages/core/src/ruffle-player.tsx index cf7312902..db187176b 100644 --- a/web/packages/core/src/ruffle-player.tsx +++ b/web/packages/core/src/ruffle-player.tsx @@ -17,8 +17,9 @@ import { buildInfo } from "./build-info"; import { text, textAsParagraphs } from "./i18n"; import { isExtension } from "./current-script"; import { configureBuilder } from "./internal/builder"; -import { PanicError, showPanicScreen } from "./internal/ui/panic"; +import { showPanicScreen } from "./internal/ui/panic"; import { RUFFLE_ORIGIN } from "./internal/constants"; +import { PanicError } from "./internal/errors"; const DIMENSION_REGEX = /^\s*(\d+(\.\d+)?(%)?)/;