From 1efd3b6f96bf26ba29efaa689884ec7a2305773a Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 6 Jul 2024 11:10:58 -0400 Subject: [PATCH] fix: Do not prompt for app install on public shares, closes #7198 --- server/routes/app.ts | 10 ++++++++-- server/static/index.html | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/server/routes/app.ts b/server/routes/app.ts index 703ed7668..f08decffd 100644 --- a/server/routes/app.ts +++ b/server/routes/app.ts @@ -52,6 +52,7 @@ export const renderApp = async ( canonical?: string; shortcutIcon?: string; rootShareId?: string; + isShare?: boolean; analytics?: Integration[]; } = {} ) => { @@ -108,11 +109,15 @@ export const renderApp = async ( .replace(/\{lang\}/g, unicodeCLDRtoISO639(env.DEFAULT_LANGUAGE)) .replace(/\{title\}/g, escape(title)) .replace(/\{description\}/g, escape(description)) + .replace( + /\{manifest-url\}/g, + options.isShare ? "" : "/static/manifest.webmanifest" + ) .replace(/\{canonical-url\}/g, canonical) - .replace(/\{shortcut-icon\}/g, shortcutIcon) + .replace(/\{shortcut-icon-url\}/g, shortcutIcon) + .replace(/\{cdn-url\}/g, env.CDN_URL || "") .replace(/\{prefetch\}/g, shareId ? "" : prefetchTags) .replace(/\{slack-app-id\}/g, env.public.SLACK_APP_ID || "") - .replace(/\{cdn-url\}/g, env.CDN_URL || "") .replace(/\{script-tags\}/g, scriptTags) .replace(/\{csp-nonce\}/g, ctx.state.cspNonce); }; @@ -175,6 +180,7 @@ export const renderShare = async (ctx: Context, next: Next) => { ? team.avatarUrl : undefined, analytics, + isShare: true, rootShareId, canonical: share ? `${share.canonicalUrl}${documentSlug && document ? document.url : ""}` diff --git a/server/static/index.html b/server/static/index.html index 33d85e267..bc8cde8cc 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -9,10 +9,10 @@ - + {prefetch} - +