Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable26] fix: Properly import the ActivityTab dynamically #1113

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
})