feat: download & like count + UI tweaks and cleanup

This commit is contained in:
2026-02-20 18:29:11 +10:30
parent 889175f3de
commit d21ce90a5c
10 changed files with 395 additions and 106 deletions
+21
View File
@@ -78,6 +78,27 @@ browser.runtime.onMessage.addListener(
return true;
}
case "fetchThemeDetails": {
const { themeId, token } = request;
if (!themeId || typeof themeId !== "string") {
sendResponse({ success: false, error: "Missing themeId" });
return false;
}
const headers: Record<string, string> = {};
if (token) headers["Authorization"] = `Bearer ${token}`;
fetch(`https://betterseqta.org/api/themes/${themeId}`, {
cache: "no-store",
headers,
})
.then((r) => r.json())
.then(sendResponse)
.catch((err) => {
console.error("[Background] fetchThemeDetails error:", err);
sendResponse({ success: false, error: err?.message });
});
return true;
}
case "fetchFromUrl": {
const { url } = request;
if (!url || typeof url !== "string") {