Fallbacks custom logo if no team was found (#9051)
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>pull/9066/head
parent
51cc956a8a
commit
942c018bd9
|
@ -23,6 +23,7 @@ const logoApiSchema = z.object({
|
|||
const SYSTEM_SUBDOMAINS = ["console", "app", "www"];
|
||||
|
||||
async function getTeamLogos(subdomain: string) {
|
||||
try {
|
||||
if (
|
||||
// if not cal.com
|
||||
IS_SELF_HOSTED ||
|
||||
|
@ -31,10 +32,7 @@ async function getTeamLogos(subdomain: string) {
|
|||
// in SYSTEM_SUBDOMAINS list
|
||||
SYSTEM_SUBDOMAINS.includes(subdomain)
|
||||
) {
|
||||
return {
|
||||
appLogo: `${WEBAPP_URL}${LOGO}`,
|
||||
appIconLogo: `${WEBAPP_URL}${LOGO_ICON}`,
|
||||
};
|
||||
throw new Error("No custom logo needed");
|
||||
}
|
||||
// load from DB
|
||||
const { default: prisma } = await import("@calcom/prisma");
|
||||
|
@ -52,6 +50,13 @@ async function getTeamLogos(subdomain: string) {
|
|||
appLogo: team.appLogo || `${WEBAPP_URL}${LOGO}`,
|
||||
appIconLogo: team.appIconLogo || `${WEBAPP_URL}${LOGO_ICON}`,
|
||||
};
|
||||
} catch (error) {
|
||||
if (error instanceof Error) console.error(error.message);
|
||||
return {
|
||||
appLogo: `${WEBAPP_URL}${LOGO}`,
|
||||
appIconLogo: `${WEBAPP_URL}${LOGO_ICON}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue