From 5e9b26ae0a435aac07c4bd37d44999e2a8a145a0 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 24 Jan 2023 08:34:03 +0000 Subject: [PATCH] Merge pull request #11412 from overleaf/bg-override-history-initialisation allow history initialisation to be overridden GitOrigin-RevId: e38c2147f7d335d368579ca53033d08906eb287b --- .../web/app/src/Features/Project/ProjectCreationHandler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/app/src/Features/Project/ProjectCreationHandler.js b/services/web/app/src/Features/Project/ProjectCreationHandler.js index 08cf1abc88..687993a7fa 100644 --- a/services/web/app/src/Features/Project/ProjectCreationHandler.js +++ b/services/web/app/src/Features/Project/ProjectCreationHandler.js @@ -158,7 +158,9 @@ async function _createBlankProject( attributes.name = projectName const project = new Project(attributes) - if (project.overleaf.history.id == null) { + // Initialise the history unless the caller has overridden it in the attributes + // (to allow scripted creation of projects without full project history) + if (project.overleaf.history.id == null && !attributes.overleaf) { const historyId = await HistoryManager.promises.initializeProject( project._id )