From 6a334e1faf144bf1991ca3f64becae17de1b87e7 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 7 May 2019 18:36:48 +0200 Subject: [PATCH] register folder icon only when the file app is being loaded if we do it earlier the theming app might not be setup yet Fixes #397 Signed-off-by: Robin Appelman --- img/folder-group.svg | 56 +------------------------------------------- src/files.js | 19 ++++++++------- 2 files changed, 12 insertions(+), 63 deletions(-) diff --git a/img/folder-group.svg b/img/folder-group.svg index 4ecabc2..d013c33 100644 --- a/img/folder-group.svg +++ b/img/folder-group.svg @@ -1,55 +1 @@ - - - - - - image/svg+xml - - - - - - - - + \ No newline at end of file diff --git a/src/files.js b/src/files.js index 9d5ac56..3cb1a46 100644 --- a/src/files.js +++ b/src/files.js @@ -21,15 +21,18 @@ */ (function(OC, OCA) { + OC.Plugins.register('OCA.Files.App', { + attach: () => { + if (OCA.Theming) { + OC.MimeType._mimeTypeIcons['dir-group'] = OC.generateUrl('/apps/theming/img/groupfolders/folder-group.svg?v=' + OCA.Theming.cacheBuster); + } else { + OC.MimeType._mimeTypeIcons['dir-group'] = OC.imagePath('groupfolders', 'folder-group'); + } + } + }); - if (OCA.Theming) { - OC.MimeType._mimeTypeIcons['dir-group'] = OC.generateUrl('/apps/theming/img/groupfolders/folder-group.svg?v=' + OCA.Theming.cacheBuster); - } else { - OC.MimeType._mimeTypeIcons['dir-group'] = OC.imagePath('groupfolders', 'folder-group'); - } - - __webpack_nonce__ = btoa(OC.requestToken) - __webpack_public_path__ = OC.linkTo('groupfolders', 'build/') + __webpack_nonce__ = btoa(OC.requestToken); + __webpack_public_path__ = OC.linkTo('groupfolders', 'build/'); var ShareTabPlugin = { attach: function (shareTabView) {