Skip to content

Commit

Permalink
Merge pull request #1113 from nextcloud/backport/1112/stable26
Browse files Browse the repository at this point in the history
[stable26] fix: Properly import the ActivityTab dynamically
  • Loading branch information
blizzz authored Mar 9, 2023
2 parents 2a58e76 + cfdce6f commit f5b9955
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/activity-sidebar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/activity-sidebar.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ __webpack_nonce__ = btoa(OC.requestToken);
__webpack_public_path__ = OC.linkTo('activity', 'js/');

// Init Activity tab component
let ActivityTab = null
let ActivityTabView = null
let ActivityTabInstance = null
const activityTab = new OCA.Files.Sidebar.Tab({
Expand All @@ -40,7 +39,7 @@ const activityTab = new OCA.Files.Sidebar.Tab({
icon: 'icon-activity',

async mount(el, fileInfo, context) {
ActivityTab = await import(/* webpackPreload: true */ './views/ActivityTab.vue')
const { default: ActivityTab } = await import(/* webpackPreload: true */ './views/ActivityTab.vue')
ActivityTabView = ActivityTabView ?? Vue.extend(ActivityTab)
if (ActivityTabInstance) {
ActivityTabInstance.$destroy()
Expand All @@ -65,7 +64,7 @@ const activityTab = new OCA.Files.Sidebar.Tab({
window.addEventListener('DOMContentLoaded', async function() {
if (OCA.Files && OCA.Files.Sidebar) {
OCA.Files.Sidebar.registerTab(activityTab)
ActivityTab = await import(/* webpackPreload: true */ './views/ActivityTab.vue')
const { default: ActivityTab } = await import(/* webpackPreload: true */ './views/ActivityTab.vue')
ActivityTabView = ActivityTabView ?? Vue.extend(ActivityTab)
}
})

0 comments on commit f5b9955

Please sign in to comment.