diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index da7c8f7c8b6..eecfc9b86e8 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -312,6 +312,11 @@ export default { }, }, watch: { + isSidebar: (isSidebar) => { + // update matching store value + this.$store.dispatch('isSidebar', isSidebar) + }, + localScreen: function(localScreen) { this._setScreenAvailable(localCallParticipantModel.attributes.peerId, localScreen) }, @@ -360,6 +365,9 @@ export default { // subviews. this.updateDataFromCallParticipantModels(this.callParticipantModels) }, + mounted() { + this.$store.dispatch('isSidebar', this.isSidebar) + }, methods: { /** * Updates data properties that depend on the CallParticipantModels. diff --git a/src/store/callViewStore.js b/src/store/callViewStore.js index 291edb5215c..c2aaab7d626 100644 --- a/src/store/callViewStore.js +++ b/src/store/callViewStore.js @@ -27,6 +27,7 @@ import { const state = { isGrid: false, + isSidebar: false, selectedVideoPeerId: null, videoBackgroundBlur: 1, } @@ -35,6 +36,9 @@ const getters = { isGrid: (state) => { return state.isGrid }, + isSidebar: (state) => { + return state.isSidebar + }, selectedVideoPeerId: (state) => { return state.selectedVideoPeerId }, @@ -48,6 +52,9 @@ const mutations = { isGrid(state, value) { state.isGrid = value }, + isSidebar(state, value) { + state.isSidebar = value + }, selectedVideoPeerId(state, value) { state.selectedVideoPeerId = value }, @@ -61,14 +68,22 @@ const actions = { * @param {bool} value true for enabled grid mode, false for speaker view; */ isGrid(context, value) { - BrowserStorage.setItem('callprefs-' + context.getters.getToken() + '-isgrid', value) + if (!context.getters.isSidebar()) { + BrowserStorage.setItem('callprefs-' + context.getters.getToken() + '-isgrid', value) + } context.commit('isGrid', value) }, + isSidebar(context, value) { + context.commit('isSidebar', value) + }, selectedVideoPeerId(context, value) { context.commit('selectedVideoPeerId', value) }, joinCall(context, { token }) { + if (context.getters.isSidebar()) { + context.dispatch('isGrid', false) + } let isGrid = BrowserStorage.getItem('callprefs-' + token + '-isgrid') if (isGrid === null) { const conversationType = context.getters.conversations[token].type