Open correct sidebar tabs when clicking the toggles

Signed-off-by: Marco <marcoambrosini@icloud.com>
This commit is contained in:
Marco 2022-11-18 13:32:52 +01:00
Родитель fe2f54ab44
Коммит 19e3bfac00
2 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -95,7 +95,7 @@
</template>
<script>
import { emit } from '@nextcloud/event-bus'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js'
import NcAppSidebarTab from '@nextcloud/vue/dist/Components/NcAppSidebarTab.js'
import SharedItemsTab from './SharedItems/SharedItemsTab.vue'
@ -274,6 +274,14 @@ export default {
},
},
mounted() {
subscribe('spreed:select-active-sidebar-tab', this.handleUpdateActive)
},
beforeDestroy() {
unsubscribe('spreed:select-active-sidebar-tab', this.handleUpdateActive)
},
methods: {
handleClose() {
this.dismissEditing()

Просмотреть файл

@ -56,7 +56,7 @@
<!-- Call time -->
<CallTime v-if="isInCall"
:start="1668761491"
:start="conversation.callStartTime"
:is-recording="isRecording"
@stop-recording="isRecording = false" />
@ -85,7 +85,7 @@
:container="container">
<NcActionButton v-if="isInCall"
key="openSideBarButtonMessageText"
@click="openSidebar">
@click="openSidebar('chat')">
<template #icon>
<MessageText :size="20"
fill-color="#ffffff" />
@ -104,7 +104,7 @@
class="top-bar__button"
close-after-click="true"
:type="isInCall ? 'tertiary-on-primary': 'tertiary'"
@click="openSidebar">
@click="openSidebar('participants')">
<template #icon>
<AccountMultiple :size="20"
:fill-color="isInCall ? '#ffffff': ''" />
@ -341,7 +341,10 @@ export default {
}
},
openSidebar() {
openSidebar(activeTab) {
if (activeTab) {
emit('spreed:select-active-sidebar-tab', activeTab)
}
this.$store.dispatch('showSidebar')
BrowserStorage.setItem('sidebarOpen', 'true')
},