From 37864a07cec17c8c3451082f121b72e790bd0ffb Mon Sep 17 00:00:00 2001 From: Kilu Date: Fri, 28 Jun 2024 19:31:16 +0800 Subject: [PATCH] fix: some style --- frontend/appflowy_web_app/server.cjs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/frontend/appflowy_web_app/server.cjs b/frontend/appflowy_web_app/server.cjs index d80d95599b..22e2f85712 100644 --- a/frontend/appflowy_web_app/server.cjs +++ b/frontend/appflowy_web_app/server.cjs @@ -92,18 +92,23 @@ const createServer = async (req) => { let title = 'AppFlowy'; const url = 'https://appflowy.io'; let image = logo; - // Inject meta data into the HTML to support SEO and social sharing - if (metaData) { - title = `${metaData.view.name} | AppFlowy`; - try { - const cover = metaData.view.extra ? JSON.parse(metaData.view.extra)?.cover : null; - if (cover && ['unsplash', 'custom'].includes(cover.type)) { - image = cover.value; + try { + // Inject meta data into the HTML to support SEO and social sharing + if (metaData && metaData.view) { + title = `${metaData.view.name} | AppFlowy`; + + try { + const cover = metaData.view.extra ? JSON.parse(metaData.view.extra)?.cover : null; + if (cover && ['unsplash', 'custom'].includes(cover.type)) { + image = cover.value; + } + } catch (_) { + // Do nothing } - } catch (_) { - // Do nothing } + } catch (error) { + logger.error(`Error injecting meta data: ${error}`); } $('title').text(title);