\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');
$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);
}