Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-12-03 17:12:18 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2022-01-08 12:14:53 +0300
commitdd7bf0f902570d4561c07237ea9072f4fc1d3edc (patch)
tree0116d397d454e95f1ebbd584230f16820c5ebd72 /apps/dashboard
parent806a176a57526b55c18817577325509dfb4ef648 (diff)
Fix dynamic loading
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dashboard')
-rw-r--r--apps/dashboard/lib/Controller/DashboardController.php2
-rw-r--r--apps/dashboard/src/main.js7
-rw-r--r--apps/dashboard/templates/index.php4
3 files changed, 6 insertions, 7 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php
index 88baa641b45..f79f8b992d1 100644
--- a/apps/dashboard/lib/Controller/DashboardController.php
+++ b/apps/dashboard/lib/Controller/DashboardController.php
@@ -94,6 +94,8 @@ class DashboardController extends Controller {
*/
public function index(): TemplateResponse {
\OCP\Util::addStyle('dashboard', 'dashboard');
+ \OCP\Util::addScript('dashboard', 'main');
+
$this->eventDispatcher->dispatchTyped(new LoadSidebar());
if (class_exists(LoadViewer::class)) {
$this->eventDispatcher->dispatchTyped(new LoadViewer());
diff --git a/apps/dashboard/src/main.js b/apps/dashboard/src/main.js
index 54c68bf71ee..f209b00baf4 100644
--- a/apps/dashboard/src/main.js
+++ b/apps/dashboard/src/main.js
@@ -25,18 +25,19 @@ import App from './App.vue'
import { translate as t } from '@nextcloud/l10n'
import VTooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import { getRequestToken } from '@nextcloud/auth'
-import { generateFilePath } from '@nextcloud/router'
// eslint-disable-next-line camelcase
__webpack_nonce__ = btoa(getRequestToken())
-// eslint-disable-next-line camelcase
-__webpack_public_path__ = generateFilePath('dashboard', '', 'js/')
Vue.directive('Tooltip', VTooltip)
Vue.prototype.t = t
// FIXME workaround to make the sidebar work
+if (!window.OCA.Files) {
+ window.OCA.Files = {}
+}
+
Object.assign(window.OCA.Files, { App: { fileList: { filesClient: OC.Files.getClient() } } }, window.OCA.Files)
const Dashboard = Vue.extend(App)
diff --git a/apps/dashboard/templates/index.php b/apps/dashboard/templates/index.php
index 9e345cdd34a..33fb41d3b78 100644
--- a/apps/dashboard/templates/index.php
+++ b/apps/dashboard/templates/index.php
@@ -1,5 +1 @@
-<?php
- declare(strict_types=1);
- \OCP\Util::addScript('dashboard', 'dashboard');
-?>
<div id="app-content-vue"></div>