Skip to content
Closed
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
8 changes: 8 additions & 0 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down Expand Up @@ -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.
Expand Down
17 changes: 16 additions & 1 deletion src/store/callViewStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {

const state = {
isGrid: false,
isSidebar: false,
selectedVideoPeerId: null,
videoBackgroundBlur: 1,
}
Expand All @@ -35,6 +36,9 @@ const getters = {
isGrid: (state) => {
return state.isGrid
},
isSidebar: (state) => {
return state.isSidebar
},
selectedVideoPeerId: (state) => {
return state.selectedVideoPeerId
},
Expand All @@ -48,6 +52,9 @@ const mutations = {
isGrid(state, value) {
state.isGrid = value
},
isSidebar(state, value) {
state.isSidebar = value
},
selectedVideoPeerId(state, value) {
state.selectedVideoPeerId = value
},
Expand All @@ -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
Expand Down