fix: Reference error visiting share link for deleted team

This commit is contained in:
Tom Moor
2022-06-03 08:58:31 +02:00
parent 4054afe6f9
commit 1dfd1e0681

View File

@@ -101,7 +101,7 @@ const renderShare = async (ctx: Context, next: Next) => {
return renderApp(ctx, next, {
title: share?.document?.title,
description: share?.document?.getSummary(),
canonical: share
canonical: share?.team
? ctx.request.href.replace(ctx.request.origin, share.team.url)
: undefined,
});