Skip to content

Commit

Permalink
Merge pull request #5555 from nextcloud/backport/5550/stable20
Browse files Browse the repository at this point in the history
[stable20] Fix quality warning tooltip not staying dismissed
  • Loading branch information
nickvergessen authored May 6, 2021
2 parents 7c8d79e + c20602d commit 8b8acc1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/CallView/shared/LocalMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<button
v-if="!isQualityWarningTooltipDismissed"
class="hint__button"
@click="isQualityWarningTooltipDismissed = true">
@click="dismissQualityWarningTooltip">
{{ t('spreed', 'Dismiss') }}
</button>
</div>
Expand Down Expand Up @@ -183,7 +183,6 @@ export default {
screenSharingMenuOpen: false,
splitScreenSharingMenu: false,
boundaryElement: document.querySelector('.main-view'),
isQualityWarningTooltipDismissed: false,
mouseover: false,
}
},
Expand Down Expand Up @@ -314,6 +313,10 @@ export default {
return (this.model.attributes.localScreen || this.splitScreenSharingMenu) ? t('spreed', 'Screensharing options') : t('spreed', 'Enable screensharing')
},
isQualityWarningTooltipDismissed() {
return this.$store.getters.isQualityWarningTooltipDismissed
},
showQualityWarningTooltip() {
return this.qualityWarningTooltip && (!this.isQualityWarningTooltipDismissed || this.mouseover)
},
Expand Down Expand Up @@ -469,16 +472,20 @@ export default {
}
if (this.qualityWarningTooltip.action === 'disableScreenShare') {
this.model.stopSharingScreen()
this.isQualityWarningTooltipDismissed = true
this.dismissQualityWarningTooltip()
} else if (this.qualityWarningTooltip.action === 'disableVideo') {
this.model.disableVideo()
this.isQualityWarningTooltipDismissed = true
this.dismissQualityWarningTooltip()
}
},
handleStopFollowing() {
this.$store.dispatch('selectedVideoPeerId', null)
},
dismissQualityWarningTooltip() {
this.$store.dispatch('dismissQualityWarningTooltip')
},
},
}
</script>
Expand Down
13 changes: 13 additions & 0 deletions src/store/callViewStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Vue from 'vue'
const state = {
isGrid: false,
selectedVideoPeerId: null,
qualityWarningTooltipDismissed: false,
backgroundImageAverageColorCache: {},
}

Expand All @@ -35,6 +36,7 @@ const getters = {
selectedVideoPeerId: (state) => {
return state.selectedVideoPeerId
},
isQualityWarningTooltipDismissed: (state) => state.qualityWarningTooltipDismissed,
getCachedBackgroundImageAverageColor: (state) => (videoBackgroundId) => {
return state.backgroundImageAverageColorCache[videoBackgroundId]
},
Expand All @@ -48,6 +50,9 @@ const mutations = {
selectedVideoPeerId(state, value) {
state.selectedVideoPeerId = value
},
setQualityWarningTooltipDismissed(state, { qualityWarningTooltipDismissed }) {
state.qualityWarningTooltipDismissed = qualityWarningTooltipDismissed
},
setCachedBackgroundImageAverageColor(state, { videoBackgroundId, backgroundImageAverageColor }) {
Vue.set(state.backgroundImageAverageColorCache, videoBackgroundId, backgroundImageAverageColor)
},
Expand All @@ -64,13 +69,21 @@ const actions = {
context.commit('selectedVideoPeerId', value)
},

joinCall(context, { token }) {
context.commit('setQualityWarningTooltipDismissed', { qualityWarningTooltipDismissed: false })
},

leaveCall(context) {
context.commit('clearBackgroundImageAverageColorCache')
},

setCachedBackgroundImageAverageColor(context, { videoBackgroundId, backgroundImageAverageColor }) {
context.commit('setCachedBackgroundImageAverageColor', { videoBackgroundId, backgroundImageAverageColor })
},

dismissQualityWarningTooltip(context) {
context.commit('setQualityWarningTooltipDismissed', { qualityWarningTooltipDismissed: true })
},
}

export default { state, mutations, getters, actions }

0 comments on commit 8b8acc1

Please sign in to comment.