Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add button to explicitly dismiss the quality warning tooltip
Instead of showing the quality warning tooltip only if it has not been
recently shown now the quality warning tooltip is always shown when
the quality warning is shown, except if the user has explicitly
dismissed it.

Signed-off-by: Marco Ambrosini <[email protected]>
  • Loading branch information
Marco Ambrosini authored and danxuliu committed Jul 20, 2020
commit b55d0b9b8cb82325e1001aa906ff5bd08068bea0
20 changes: 18 additions & 2 deletions src/components/CallView/shared/LocalMediaControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@
:boundaries-element="boundaryElement"
:aria-label="qualityWarningAriaLabel"
trigger="hover"
:open="qualityWarningTooltip.show">
:auto-hide="false"
:open="showQualityWarningTooltip">
<NetworkStrength2Alert
slot="trigger"
fill-color="#e9322d"
title=""
:size="24" />
:size="24"
@mouseover="mouseover = true"
@mouseleave="mouseover = false" />
<div class="hint">
<span>{{ qualityWarningTooltip.content }}</span>
<div class="hint__actions">
Expand All @@ -101,6 +104,11 @@
@click="executeQualityWarningTooltipAction">
{{ qualityWarningTooltip.actionLabel }}
</button>
<button
v-if="!isQualityWarningTooltipDismissed"
@click="isQualityWarningTooltipDismissed = true">
{{ t('spreed', 'Dismiss') }}
</button>
</div>
</div>
</Popover>
Expand Down Expand Up @@ -159,6 +167,8 @@ export default {
screenSharingMenuOpen: false,
splitScreenSharingMenu: false,
boundaryElement: document.querySelector('.main-view'),
isQualityWarningTooltipDismissed: false,
mouseover: false,
}
},

Expand Down Expand Up @@ -288,6 +298,10 @@ export default {
return (this.model.attributes.localScreen || this.splitScreenSharingMenu) ? t('spreed', 'Screensharing options') : t('spreed', 'Enable screensharing')
},

showQualityWarningTooltip() {
return this.qualityWarningTooltip && (!this.isQualityWarningTooltipDismissed || this.mouseover)
},

},

created() {
Expand Down Expand Up @@ -430,8 +444,10 @@ export default {
}
if (this.qualityWarningTooltip.action === 'disableScreenShare') {
this.model.stopSharingScreen()
this.isQualityWarningTooltipDismissed = true
} else if (this.qualityWarningTooltip.action === 'disableVideo') {
this.model.disableVideo()
this.isQualityWarningTooltipDismissed = true
}
},
},
Expand Down
25 changes: 0 additions & 25 deletions src/components/CallView/shared/LocalVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export default {
return {
callAnalyzer: callAnalyzer,
qualityWarningInGracePeriodTimeout: null,
qualityWarningWasRecentlyShownTimeout: null,
}
},

Expand Down Expand Up @@ -207,14 +206,6 @@ export default {
return label
},

// The quality warning tooltip is automatically shown only if the
// quality warning has not been shown in the last minute. Otherwise the
// tooltip is hidden even if the warning is shown, although the tooltip
// can be shown anyway by hovering on the warning.
showQualityWarningTooltip() {
return !this.qualityWarningWasRecentlyShownTimeout
},

qualityWarningTooltip() {
if (!this.showQualityWarning) {
return null
Expand Down Expand Up @@ -251,8 +242,6 @@ export default {
tooltip.action = ''
}

tooltip.show = this.showQualityWarningTooltip

return tooltip
},
},
Expand Down Expand Up @@ -303,20 +292,6 @@ export default {
}, 10000)
},

showQualityWarning: function(showQualityWarning) {
if (showQualityWarning) {
return
}

if (this.qualityWarningWasRecentlyShownTimeout) {
window.clearTimeout(this.qualityWarningWasRecentlyShownTimeout)
}

this.qualityWarningWasRecentlyShownTimeout = window.setTimeout(() => {
this.qualityWarningWasRecentlyShownTimeout = null
}, 60000)
},

},

mounted() {
Expand Down