pwa icon
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-06 14:42:18 +03:30
parent 1ce80f551c
commit c9d152fbaf
8 changed files with 35 additions and 27 deletions
+5
View File
@@ -14,6 +14,10 @@ export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ name: string }> },
) {
// Restaurant logo processing disabled redirect to static PWA icon
return NextResponse.redirect(new URL(PWA_ICON_192, request.url), 302);
/* Restaurant logo processing uncomment to re-enable dynamic PWA icons
try {
await params;
@@ -91,4 +95,5 @@ export async function GET(
console.error("Error processing logo:", error);
return NextResponse.redirect(new URL(DEFAULT_ICON, request.url), 302);
}
*/
}
+10 -10
View File
@@ -9,17 +9,17 @@ export async function buildRestaurantMetadata(name: string): Promise<Metadata> {
try {
const restaurant = await getRestaurant(name);
const title = restaurant.seoTitle || restaurant.name;
const logo = restaurant.logo;
// Restaurant logo disabled using static PWA icons (logo192.png / logo512.png)
// const logo = restaurant.logo;
// if (logo && logo.trim() !== "") {
// iconUrl = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=192`;
// icon192Url = iconUrl;
// icon512Url = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=512`;
// }
let iconUrl = defaultIcon;
let icon192Url = defaultIcon;
let icon512Url = defaultIcon512;
if (logo && logo.trim() !== "") {
iconUrl = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=192`;
icon192Url = iconUrl;
icon512Url = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=512`;
}
const iconUrl = defaultIcon;
const icon192Url = defaultIcon;
const icon512Url = defaultIcon512;
return {
title,
+7 -6
View File
@@ -5,12 +5,13 @@ import { getRestaurant } from "../lib/getRestaurant";
export const dynamic = "force-dynamic";
export const revalidate = 0;
function buildManifestIcons(name: string, logo?: string | null) {
if (logo && logo.trim() !== "") {
const logo192 = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=192`;
const logo512 = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=512`;
return buildPwaManifestIcons(logo192, logo512);
}
function buildManifestIcons(_name: string, _logo?: string | null) {
// Restaurant logo disabled using static PWA icons (logo192.png / logo512.png)
// if (logo && logo.trim() !== "") {
// const logo192 = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=192`;
// const logo512 = `/${name}/api/logo?url=${encodeURIComponent(logo)}&size=512`;
// return buildPwaManifestIcons(logo192, logo512);
// }
return buildPwaManifestIcons();
}