From c578679dabca638cf059856659aa0812a100a81d Mon Sep 17 00:00:00 2001 From: Cezar Augusto Date: Mon, 22 May 2017 23:46:39 -0300 Subject: [PATCH] Trigger tab preview based on frame key - Auditors: @bsclifton, @luixxiul - Close: #7606 --- app/renderer/reducers/frameReducer.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/renderer/reducers/frameReducer.js b/app/renderer/reducers/frameReducer.js index 79cc138ab54..fecc1203fdb 100644 --- a/app/renderer/reducers/frameReducer.js +++ b/app/renderer/reducers/frameReducer.js @@ -52,10 +52,15 @@ const closeFrame = (state, action) => { const nextFrame = frameStateUtil.getFrameByIndex(state, index) - // Copy the hover state if tab closed with mouse as long as we have a next frame - // This allow us to have closeTab button visible for sequential frames closing, until onMouseLeave event happens. - if (hoverState && nextFrame) { - windowActions.setTabHoverState(nextFrame.get('key'), hoverState) + if (nextFrame) { + // After closing a tab, preview the next frame + // as long as there is one + windowActions.setPreviewFrame(nextFrame.get('key')) + // Copy the hover state if tab closed with mouse as long as we have a next frame + // This allow us to have closeTab button visible for sequential frames closing, until onMouseLeave event happens. + if (hoverState) { + windowActions.setTabHoverState(nextFrame.get('key'), hoverState) + } } return state