diff --git a/public/sw.js b/public/sw.js index 99eed21..95b8616 100644 --- a/public/sw.js +++ b/public/sw.js @@ -15,7 +15,7 @@ function loadExtensionScripts() { let store = transaction.objectStore("InstalledExtensions"); let request = store.getAll(); request.onsuccess = () => { - let extensions = request.result; + let extensions = request.result.filter((extension) => extension.type != "theme"); extensions.forEach((extension) => { eval(atob(extension.scriptCopy)); const func = self[extension.entryNamespace][extension.entryFunc]; diff --git a/src/components/UI/MarketplaceIcon.astro b/src/components/UI/MarketplaceIcon.astro index e181b8b..0b2cc19 100644 --- a/src/components/UI/MarketplaceIcon.astro +++ b/src/components/UI/MarketplaceIcon.astro @@ -1,30 +1,31 @@ --- +import Paintbrush from "@components/icons/paintbrush.astro"; +import Scroll from "@components/icons/scroll.astro"; + const { type } = Astro.props; type Props = { type: ExtType; }; -let icon = "fa-solid fa-paintbrush"; -let abbrTitle = "Style"; - -if (type === "page" || type === "serviceWorker") { - icon = "fa-solid fa-scroll"; - abbrTitle = "Script"; -} +const abbrTitle = type === "theme" ? "Theme" : "Script"; ---
- + {type === "theme" ? : }
- diff --git a/src/components/icons/paintbrush.astro b/src/components/icons/paintbrush.astro new file mode 100644 index 0000000..7c7fd55 --- /dev/null +++ b/src/components/icons/paintbrush.astro @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/components/icons/scroll.astro b/src/components/icons/scroll.astro new file mode 100644 index 0000000..449da43 --- /dev/null +++ b/src/components/icons/scroll.astro @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/components/ts/marketplace.ts b/src/components/ts/marketplace.ts index 5edc5ad..1ee993b 100644 --- a/src/components/ts/marketplace.ts +++ b/src/components/ts/marketplace.ts @@ -1,8 +1,8 @@ import "notyf/notyf.min.css"; import { Notyf } from "notyf"; import marketplaceManifest from "../../json/marketplace.json"; -const installButtons = document.getElementsByClassName("btn-install"); import IDBManager, { loadIDBPromise } from "./IDBManager"; +const installButtons = document.getElementsByClassName("btn-install"); const extManifest = marketplaceManifest as ExtensionMetadataJSON; diff --git a/src/pages/[lang]/marketplace.astro b/src/pages/[lang]/marketplace.astro index 15ed901..95e496a 100644 --- a/src/pages/[lang]/marketplace.astro +++ b/src/pages/[lang]/marketplace.astro @@ -11,7 +11,7 @@ export const getStaticPaths = () => { }; --- - +

Marketplace

(WIP) Install custom extensions for Alu!

diff --git a/src/pages/index.astro b/src/pages/index.astro index dc15bee..047ae2b 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -36,14 +36,9 @@ import SchemaData from "@components/SchemaData.astro"; import instantiateAlu from "@components/ts/Alu"; instantiateAlu(); const lang = Alu.store.get("lang"); - const redirect = (loc: string) => (window.location.href = loc); + const redirect = (loc: string) => window.location.href = loc; if (lang) { - try { - redirect(`/${lang.value}/`); - } catch { - localStorage.clear(); - window.location.reload(); - } + redirect(`/${lang.value}/`); } else { const lang = navigator.language; if (lang.includes("ja")) { diff --git a/tsconfig.json b/tsconfig.json index 4014ca2..1a012f2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "baseUrl": ".", "paths": { "@components/*": ["src/components/*"], + "@icons/*": ["src/icons/*"], "@i18n/*": ["src/i18n/*"], "@json/*": ["src/json/*"] }