Skip to content

Commit

Permalink
fix: minimize the number of updates for lastIs.. and keep user prefer…
Browse files Browse the repository at this point in the history
…ences that are set during presentation

Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad authored and Antreesy committed May 13, 2024
1 parent d047542 commit 59c39ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/TopBar/TopBarMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ export default {
},

changeView() {
this.$store.dispatch('setCallViewMode', { isGrid: !this.isGrid })
this.$store.dispatch('setCallViewMode', { isGrid: !this.isGrid, clearLast: false })
this.$store.dispatch('selectedVideoPeerId', null)
},

Expand Down
15 changes: 9 additions & 6 deletions src/store/callViewStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,15 @@ const actions = {
if (!context.getters.presentationStarted) {
return
}

// restore previous state
context.dispatch('setCallViewMode', {
isGrid: context.getters.lastIsGrid,
isStripeOpen: context.getters.lastIsStripeOpen,
})
if (!context.getters.isGrid && !context.getters.isStripeOpen) {
// User didn't pick grid view during presentation
// restore previous state
context.dispatch('setCallViewMode', {
isGrid: context.getters.lastIsGrid,
isStripeOpen: context.getters.lastIsStripeOpen,
clearLast: false,
})
}
context.commit('presentationStarted', false)
},

Expand Down

0 comments on commit 59c39ff

Please sign in to comment.