mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-23 10:51:02 +00:00
Merge branch 'main' into feature/clearpaths
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<title>Hydra</title>
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self' 'unsafe-inline' *;"
|
||||
content="default-src 'self' 'unsafe-inline' * data: local:;"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -119,25 +119,13 @@ export function App() {
|
||||
if (response) {
|
||||
updateUserDetails(response);
|
||||
syncFriendRequests();
|
||||
|
||||
const $existingScript = document.getElementById("user-details");
|
||||
|
||||
const content = `window.userDetails = ${JSON.stringify(response)};`;
|
||||
|
||||
if ($existingScript) {
|
||||
$existingScript.textContent = content;
|
||||
} else {
|
||||
const $script = document.createElement("script");
|
||||
$script.id = "user-details";
|
||||
$script.type = "text/javascript";
|
||||
$script.textContent = content;
|
||||
|
||||
document.head.appendChild($script);
|
||||
}
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (document.getElementById("external-resources")) return;
|
||||
|
||||
const $script = document.createElement("script");
|
||||
$script.id = "external-resources";
|
||||
$script.src = `${import.meta.env.RENDERER_VITE_EXTERNAL_RESOURCES_URL}?t=${Date.now()}`;
|
||||
document.head.appendChild($script);
|
||||
});
|
||||
|
||||
@@ -56,6 +56,8 @@ export function useUserDetails() {
|
||||
clearUserDetails();
|
||||
}
|
||||
|
||||
window["userDetails"] = userDetails;
|
||||
|
||||
return userDetails;
|
||||
});
|
||||
}, [clearUserDetails]);
|
||||
|
||||
@@ -20,6 +20,7 @@ import resources from "@locales";
|
||||
|
||||
import { RepacksContextProvider } from "./context";
|
||||
import { SuspenseWrapper } from "./components";
|
||||
import { logger } from "./logger";
|
||||
|
||||
const Home = React.lazy(() => import("./pages/home/home"));
|
||||
const GameDetails = React.lazy(
|
||||
@@ -34,6 +35,8 @@ const Achievements = React.lazy(
|
||||
() => import("./pages/achievements/achievements")
|
||||
);
|
||||
|
||||
console.log = logger.log;
|
||||
|
||||
i18n
|
||||
.use(LanguageDetector)
|
||||
.use(initReactI18next)
|
||||
|
||||
Reference in New Issue
Block a user