Skip to content

Commit

Permalink
Merge pull request #108 from DeckThemes/dev
Browse files Browse the repository at this point in the history
Version 2.0.3: Minor bug fixes
  • Loading branch information
beebls authored Jan 12, 2024
2 parents a321e9e + 22519a1 commit 9ea96f3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/QAMTab/MOTDDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion src/pages/theme-manager/ExpandedView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
<div className="image-number-container">
Expand Down

0 comments on commit 9ea96f3

Please sign in to comment.