From 56a526e930ed022d114f605df03a3ffac621fa25 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 13 Sep 2023 20:54:37 -0400 Subject: [PATCH] fix: Respect fullWidth setting when creating document from template --- server/commands/documentCreator.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/commands/documentCreator.ts b/server/commands/documentCreator.ts index bd3853b48..fd86a0322 100644 --- a/server/commands/documentCreator.ts +++ b/server/commands/documentCreator.ts @@ -80,13 +80,14 @@ export default async function documentCreator({ createdById: user.id, template, templateId, - fullWidth, publishedAt, importId, + fullWidth: templateDocument ? templateDocument.fullWidth : fullWidth, emoji: templateDocument ? templateDocument.emoji : emoji, - title: templateDocument - ? DocumentHelper.replaceTemplateVariables(templateDocument.title, user) - : title, + title: DocumentHelper.replaceTemplateVariables( + templateDocument ? templateDocument.title : title, + user + ), text: await DocumentHelper.replaceImagesWithAttachments( DocumentHelper.replaceTemplateVariables( templateDocument ? templateDocument.text : text,