@@ -242,6 +242,16 @@ const tabDataChanged = (state, action) => {
242
242
if ( frameProps ) {
243
243
state = state . mergeIn ( [ 'frames' , frameStateUtil . getFramePropsIndex ( frameStateUtil . getFrames ( state ) , frameProps ) ] , newProps )
244
244
state = state . mergeIn ( [ 'tabs' , frameStateUtil . getFramePropsIndex ( frameStateUtil . getFrames ( state ) , frameProps ) ] , newProps )
245
+ if ( tab . get ( 'active' ) === true && tab . get ( 'windowId' ) === getCurrentWindowId ( ) ) {
246
+ state = state . merge ( {
247
+ activeFrameKey : frameProps . get ( 'key' ) ,
248
+ previewFrameKey : null
249
+ } )
250
+ state = state . mergeIn ( [ 'frames' , frameStateUtil . getFramePropsIndex ( frameStateUtil . getFrames ( state ) , action . frameProps ) ] , {
251
+ lastAccessedTime : new Date ( ) . getTime ( ) } )
252
+ state = state . deleteIn ( [ 'ui' , 'tabs' , 'previewTabPageIndex' ] )
253
+ state = updateTabPageIndex ( state , frameProps )
254
+ }
245
255
}
246
256
} )
247
257
return state
@@ -381,19 +391,6 @@ const doAction = (action) => {
381
391
case windowConstants . WINDOW_CLEAR_CLOSED_FRAMES :
382
392
windowState = windowState . set ( 'closedFrames' , new Immutable . List ( ) )
383
393
break
384
- case windowConstants . WINDOW_ACTIVE_FRAME_CHANGED :
385
- if ( ! action . frameProps ) {
386
- break
387
- }
388
- windowState = windowState . merge ( {
389
- activeFrameKey : action . frameProps . get ( 'key' ) ,
390
- previewFrameKey : null
391
- } )
392
- windowState = windowState . mergeIn ( [ 'frames' , frameStateUtil . getFramePropsIndex ( frameStateUtil . getFrames ( windowState ) , action . frameProps ) ] , {
393
- lastAccessedTime : new Date ( ) . getTime ( ) } )
394
- windowState = windowState . deleteIn ( [ 'ui' , 'tabs' , 'previewTabPageIndex' ] )
395
- windowState = updateTabPageIndex ( windowState , action . frameProps )
396
- break
397
394
case windowConstants . WINDOW_SET_PREVIEW_FRAME :
398
395
windowState = windowState . merge ( {
399
396
previewFrameKey : action . frameProps && action . frameProps . get ( 'key' ) !== windowState . get ( 'activeFrameKey' )
0 commit comments