diff --git a/package-lock.json b/package-lock.json index 90234f4..ffa8336 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "SDH-CssLoader", - "version": "1.8.0", + "version": "2.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "SDH-CssLoader", - "version": "1.8.0", + "version": "2.0.2", "license": "GPL-2.0-or-later", "dependencies": { "color": "^4.2.3", "decky-frontend-lib": "^3.22.0", "lodash": "^4.17.21", - "react-icons": "^4.3.1" + "react-icons": "^4.12.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^21.1.0", @@ -2274,9 +2274,9 @@ } }, "node_modules/react-icons": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.4.0.tgz", - "integrity": "sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.12.0.tgz", + "integrity": "sha512-IBaDuHiShdZqmfc/TwHu6+d6k2ltNCf3AszxNmjJc1KUfXdEeRJOKyNvLmAHaarhzGmTSVygNdyu8/opXv2gaw==", "peerDependencies": { "react": "*" } @@ -4559,9 +4559,9 @@ } }, "react-icons": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.4.0.tgz", - "integrity": "sha512-fSbvHeVYo/B5/L4VhB7sBA1i2tS8MkT0Hb9t2H1AVPkwGfVHLJCqyr2Py9dKMxsyM63Eng1GkdZfbWj+Fmv8Rg==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.12.0.tgz", + "integrity": "sha512-IBaDuHiShdZqmfc/TwHu6+d6k2ltNCf3AszxNmjJc1KUfXdEeRJOKyNvLmAHaarhzGmTSVygNdyu8/opXv2gaw==", "requires": {} }, "rechoir": { diff --git a/package.json b/package.json index ae71b3d..55ddf96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "SDH-CssLoader", - "version": "2.0.2", + "version": "2.0.3", "description": "A css loader", "scripts": { "build": "shx rm -rf dist && rollup -c", diff --git a/rollup.config.js b/rollup.config.js index 788620f..a0bcc37 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -26,13 +26,13 @@ export default defineConfig({ }), ], context: "window", - external: ["react", "react-dom"], + external: ["react", "react-dom", "decky-frontend-lib"], output: { file: "dist/index.js", globals: { react: "SP_REACT", "react-dom": "SP_REACTDOM", - // "decky-frontend-lib": "DFL", + "decky-frontend-lib": "DFL", }, format: "iife", exports: "default", diff --git a/src/api.ts b/src/api.ts index 2bd8f04..dd2a9d7 100644 --- a/src/api.ts +++ b/src/api.ts @@ -165,7 +165,9 @@ export async function genericGET( throw new Error(`No json returned!`); }) .catch((err) => { - console.error(`Error fetching ${fetchPath}`, err); + if (!failSilently) { + console.error(`Error fetching ${fetchPath}`, err); + } onError(); }); } diff --git a/src/components/QAMTab/MOTDDisplay.tsx b/src/components/QAMTab/MOTDDisplay.tsx index 0ef7953..c586651 100644 --- a/src/components/QAMTab/MOTDDisplay.tsx +++ b/src/components/QAMTab/MOTDDisplay.tsx @@ -11,7 +11,7 @@ export function MOTDDisplay() { const { hiddenMotd, setGlobalState } = useCssLoaderState(); useEffect(() => { async function getMotd() { - const res = await genericGET("/motd", false); + const res = await genericGET("/motd", false, undefined, () => {}, true); setMotd(res); } getMotd(); diff --git a/src/pages/theme-manager/ExpandedView.tsx b/src/pages/theme-manager/ExpandedView.tsx index c4f027c..653b9fb 100644 --- a/src/pages/theme-manager/ExpandedView.tsx +++ b/src/pages/theme-manager/ExpandedView.tsx @@ -255,7 +255,11 @@ export const ExpandedViewPage: VFC = () => { width={selectedImageWidth} height={selectedImageHeight} style={{ objectFit: "contain" }} - src={`https://api.deckthemes.com/blobs/${fullThemeData.images[focusedImage].id}`} + src={ + fullThemeData.images.length > 0 + ? `https://api.deckthemes.com/blobs/${fullThemeData.images?.[focusedImage]?.id}` + : `https://share.deckthemes.com/cssplaceholder.png` + } /> {fullThemeData.images.length > 1 && (