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'
3437import { defineAsyncComponent , defineComponent , h } from ' vue'
3538import NcButton from ' @nextcloud/vue/components/NcButton'
3639import LoadingComponent from ' ./components/LoadingComponent.vue'
40+ import { useIsInCall } from ' ./composables/useIsInCall.js'
3741import { useSessionIssueHandler } from ' ./composables/useSessionIssueHandler.ts'
3842import { EventBus } from ' ./services/EventBus.ts'
3943import { 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"
0 commit comments