diff --git a/app/common/state/tabContentState/audioState.js b/app/common/state/tabContentState/audioState.js index 49b8b5835d8..4f88eb9089d 100644 --- a/app/common/state/tabContentState/audioState.js +++ b/app/common/state/tabContentState/audioState.js @@ -49,6 +49,10 @@ module.exports.showAudioTopBorder = (state, frameKey, isPinned) => { return false } + if (module.exports.isAudioMuted(state, frameKey)) { + return false + } + return ( module.exports.canPlayAudio(state, frameKey) && (isEntryIntersected(state, 'tabs') || isPinned) diff --git a/test/unit/app/common/state/tabContentStateTest/audioStateTest.js b/test/unit/app/common/state/tabContentStateTest/audioStateTest.js index 0ac91b32b9f..20a005721ff 100644 --- a/test/unit/app/common/state/tabContentStateTest/audioStateTest.js +++ b/test/unit/app/common/state/tabContentStateTest/audioStateTest.js @@ -160,5 +160,13 @@ describe('audioState unit tests', function () { const result = audioState.showAudioTopBorder(state, frameKey, false) assert.equal(result, false) }) + + it('return false if tab audio is mute and not pinned', function * () { + const state = defaultState + .setIn(['frames', index, 'audioPlayback'], true) + .setIn(['frames', index, 'audioMuted'], true) + const result = audioState.showAudioTopBorder(state, frameKey, false) + assert.equal(result, false) + }) }) })