From 5a574737ada72f95a6d3a523f5f14f1d99c55f4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Wed, 11 Mar 2020 14:20:30 +0100
Subject: [PATCH] Only load required scripts on install page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 lib/private/legacy/template.php | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php
index 757bf998d32..ed1e5627961 100644
--- a/lib/private/legacy/template.php
+++ b/lib/private/legacy/template.php
@@ -109,16 +109,18 @@ class OC_Template extends \OC\Template\Base {
 					OC_Util::addScript ( 'backgroundjobs', null, true );
 				}
 			}
-
 			OC_Util::addStyle('css-variables', null, true);
 			OC_Util::addStyle('server', null, true);
-			OC_Util::addTranslations("core", null, true);
-			OC_Util::addStyle('search', 'results');
-			OC_Util::addScript('search', 'search', true);
-			OC_Util::addScript('search', 'searchprovider');
-			OC_Util::addScript('merged-template-prepend', null, true);
-			OC_Util::addScript('files/fileinfo');
-			OC_Util::addScript('files/client');
+			OC_Util::addTranslations('core', null, true);
+
+			if (\OC::$server->getSystemConfig()->getValue ('installed', false)) {
+				OC_Util::addStyle('search', 'results');
+				OC_Util::addScript('search', 'search', true);
+				OC_Util::addScript('search', 'searchprovider');
+				OC_Util::addScript('merged-template-prepend', null, true);
+				OC_Util::addScript('files/fileinfo');
+				OC_Util::addScript('files/client');
+			}
 			OC_Util::addScript('core', 'dist/main', true);
 
 			if (\OC::$server->getRequest()->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE])) {
-- 
GitLab