don't always add core/common and core/main during "sorting"

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/39867/head
Robin Appelman 10 months ago
parent ccf57e0715
commit 37e3115cb4

@ -49,6 +49,12 @@ class BeforeTemplateRenderedListener implements IEventListener {
\OC_Util::addStyle('server', null, true);
if ($event instanceof BeforeLoginTemplateRenderedEvent) {
// todo: make login work without these
Util::addScript('core', 'common');
Util::addScript('core', 'main');
}
if ($event instanceof BeforeTemplateRenderedEvent) {
// include common nextcloud webpack bundle
Util::addScript('core', 'common');

@ -212,7 +212,12 @@ class Util {
$sortedScripts = $sortedScripts ? array_merge(...array_values(($sortedScripts))) : [];
// Override core-common and core-main order
array_unshift($sortedScripts, 'core/js/common', 'core/js/main');
if (in_array('core/js/main', $sortedScripts)) {
array_unshift($sortedScripts, 'core/js/main');
}
if (in_array('core/js/common', $sortedScripts)) {
array_unshift($sortedScripts, 'core/js/common');
}
return array_unique($sortedScripts);
}

Loading…
Cancel
Save