fix (backend): remove unused parameter from manifest

This commit is contained in:
naskya 2024-05-21 09:59:27 +09:00
parent b27c16ebdb
commit 02361b6dc6
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -1,6 +1,5 @@
import type Koa from "koa";
import { fetchMeta } from "backend-rs";
import { config } from "@/config.js";
const manifest = {
short_name: "Firefish",
@ -83,15 +82,7 @@ export const manifestHandler = async (ctx: Koa.Context) => {
manifest.short_name = instance.name || "Firefish";
manifest.name = instance.name || "Firefish";
if (instance.themeColor) manifest.theme_color = instance.themeColor;
for (const icon of manifest.icons) {
icon.src = `${icon.src}?v=${config.version.replace(/[^0-9]/g, "")}`;
}
for (const screenshot of manifest.screenshots) {
screenshot.src = `${screenshot.src}?v=${config.version.replace(
/[^0-9]/g,
"",
)}`;
}
ctx.set("Cache-Control", "max-age=300");
ctx.body = manifest;
};