From aee3f33fce20e221f7e9b938f7833fbc53b94f42 Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Thu, 19 Aug 2021 17:22:13 +0300 Subject: [PATCH] Fix the project CLI flag (#1774) fix the --project flag --- src/js/lib/content/src/index.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/js/lib/content/src/index.ts b/src/js/lib/content/src/index.ts index 353cd7b775..998f40f994 100644 --- a/src/js/lib/content/src/index.ts +++ b/src/js/lib/content/src/index.ts @@ -946,6 +946,17 @@ async function mainEntryPoint(config: Config) { } } +async function runEntryPoint(config: Config) { + if (ok(config.project)) { + await mainEntryPoint(config) + } else { + await templates.loadTemplatesView((name: string) => { + config.project = name + mainEntryPoint(config) + }) + } +} + API.main = async function(inputConfig: any) { const urlParams = new URLSearchParams(window.location.search) // @ts-ignore @@ -959,16 +970,10 @@ API.main = async function(inputConfig: any) { if (config.authentication_enabled && !Versions.isDevVersion()) { new FirebaseAuthentication(function(user: any) { config.email = user.email - templates.loadTemplatesView((name: string) => { - config.project = name - mainEntryPoint(config) - }) + runEntryPoint(config) }) } else { - await templates.loadTemplatesView((name: string) => { - config.project = name - mainEntryPoint(config) - }) + await runEntryPoint(config) } } else { // Display a message asking to update the application.