+
+ {code ?? ":-("}
+
+
+ {heading ?? "Oops! Something went wrong."}
+
+
+ {content ?? "Please try to refresh the page or come back later."}
+
+
+ {action && (
+
+ )}
+
+ {debug && (
+
+ )}
+
+ {debug && isDebug && (
+
+
+ {debug}
+
+
+ )}
+
+ );
+};
diff --git a/frontend/src/src/helpers/app/getProtocol.tsx b/frontend/src/src/helpers/app/getProtocol.tsx
index 40b5c5c75..551c6d62d 100644
--- a/frontend/src/src/helpers/app/getProtocol.tsx
+++ b/frontend/src/src/helpers/app/getProtocol.tsx
@@ -6,7 +6,7 @@ export const getProtocol = (http: boolean) => {
return window.location.protocol === "https:" ? "wss:" : "ws:";
}
if (http) {
- return process.env.REACT_APP_BACKEND_TLS ? "https:" : "http:";
+ return process.env.REACT_APP_BACKEND_TLS === "true" ? "https:" : "http:";
}
- return process.env.REACT_APP_BACKEND_TLS ? "wss:" : "ws:";
+ return process.env.REACT_APP_BACKEND_TLS === "true" ? "wss:" : "ws:";
};
diff --git a/frontend/src/src/helpers/app/hideLoading.tsx b/frontend/src/src/helpers/app/hideLoading.tsx
new file mode 100644
index 000000000..5d0939747
--- /dev/null
+++ b/frontend/src/src/helpers/app/hideLoading.tsx
@@ -0,0 +1,9 @@
+export const hideLoading = () => {
+ const loadingScreen = document.querySelector(".public-loading") as HTMLElement;
+ if (loadingScreen) {
+ loadingScreen.style.opacity = "0";
+ setTimeout(() => {
+ document.querySelector(".public-loading")?.remove();
+ }, 500);
+ }
+};
diff --git a/frontend/src/src/index.tsx b/frontend/src/src/index.tsx
index 422a1dc23..70fc9529b 100644
--- a/frontend/src/src/index.tsx
+++ b/frontend/src/src/index.tsx
@@ -3,6 +3,7 @@ import "./index.css";
import { StyledEngineProvider } from "@mui/material/styles";
import ReactDOM from "react-dom/client";
+import { ErrorBoundary } from "react-error-boundary";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
@@ -10,16 +11,19 @@ import App from "./App";
import { RouterWrapper } from "./components/RouterWrapper";
import { routerConfig } from "./config/router";
import store, { REDUX_PRESIST } from "./config/store";
+import { Error } from "./Error";
const root = ReactDOM.createRoot(document.getElementById("root")!);
root.render(
-