Skip to content

Commit f9727b6

Browse files
authored
Merge pull request #15667 from nextcloud/fix/noid/files-sidebar
2 parents 6a9c5da + ac6f5b3 commit f9727b6

6 files changed

Lines changed: 131 additions & 357 deletions

src/FilesSidebarCallViewApp.vue

Lines changed: 0 additions & 304 deletions
This file was deleted.

src/FilesSidebarTabApp.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
{{ t('spreed', 'Join conversation') }}
2323
</NcButton>
2424
</div>
25-
<FilesSidebarChatView v-else />
25+
<template v-else>
26+
<FilesSidebarCallView v-if="isInFile && isInCall" />
27+
<FilesSidebarChatView />
28+
</template>
2629
</div>
2730
</template>
2831

@@ -34,6 +37,7 @@ import { t } from '@nextcloud/l10n'
3437
import { defineAsyncComponent, defineComponent, h } from 'vue'
3538
import NcButton from '@nextcloud/vue/components/NcButton'
3639
import LoadingComponent from './components/LoadingComponent.vue'
40+
import { useIsInCall } from './composables/useIsInCall.js'
3741
import { useSessionIssueHandler } from './composables/useSessionIssueHandler.ts'
3842
import { EventBus } from './services/EventBus.ts'
3943
import { getFileConversation } from './services/filesIntegrationServices.ts'
@@ -56,11 +60,17 @@ export default {
5660
loadingComponent: defineComponent(() => h(LoadingComponent, { class: 'tab-loading' })),
5761
}),
5862
63+
FilesSidebarCallView: defineAsyncComponent({
64+
loader: () => import(/* webpackChunkName: "files-sidebar-call-chunk" */'./views/FilesSidebarCallView.vue'),
65+
loadingComponent: defineComponent(() => h(LoadingComponent, { class: 'tab-loading' })),
66+
}),
67+
5968
NcButton,
6069
},
6170
6271
setup() {
6372
return {
73+
isInCall: useIsInCall(),
6474
isLeavingAfterSessionIssue: useSessionIssueHandler(),
6575
actorStore: useActorStore(),
6676
tokenStore: useTokenStore(),
@@ -97,6 +107,20 @@ export default {
97107
return this.tokenStore.fileIdForToken
98108
},
99109
110+
/**
111+
* Returns whether the sidebar is opened in the file of the current
112+
* conversation or not.
113+
*
114+
* Note that false is returned too when the sidebar is closed, even if
115+
* the conversation is active in the current file.
116+
*
117+
* @return {boolean} true if the sidebar is opened in the file, false
118+
* otherwise.
119+
*/
120+
isInFile() {
121+
return this.fileId === this.fileIdForToken
122+
},
123+
100124
isChatTheActiveTab() {
101125
// FIXME check for empty active tab is currently needed because the
102126
// activeTab is not set when opening the sidebar from the "Details"

src/mainFilesSidebar.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { getCSPNonce } from '@nextcloud/auth'
77
import { generateFilePath } from '@nextcloud/router'
88
import { createApp, reactive } from 'vue'
9-
import FilesSidebarCallViewApp from './FilesSidebarCallViewApp.vue'
109
import FilesSidebarTabApp from './FilesSidebarTabApp.vue'
1110
import { createMemoryRouter } from './router/router.ts'
1211
import store from './store/index.js'
@@ -30,17 +29,6 @@ __webpack_public_path__ = generateFilePath('spreed', '', 'js/')
3029

3130
const router = createMemoryRouter()
3231

33-
/**
34-
*
35-
*/
36-
function newCallView() {
37-
return createApp(FilesSidebarCallViewApp)
38-
.use(store)
39-
.use(pinia)
40-
.use(router)
41-
.use(NextcloudGlobalsVuePlugin)
42-
}
43-
4432
/**
4533
*
4634
*/
@@ -57,7 +45,6 @@ if (!window.OCA.Talk) {
5745
}
5846
Object.assign(window.OCA.Talk, {
5947
fileInfo: null,
60-
newCallView,
6148
newTab,
6249
store,
6350
})

0 commit comments

Comments
 (0)