@@ -13,7 +13,7 @@ export default function mainReducer(state, action) {
13
13
if ( snapshots . length > 0 && sliderIndex > 0 ) {
14
14
const newIndex = sliderIndex - 1 ;
15
15
16
- port . postMessage ( { action : 'jumpToSnap' , payload : snapshots [ newIndex ] } ) ;
16
+ port . postMessage ( { action : 'jumpToSnap' , payload : snapshots [ newIndex ] , tabId : currentTab } ) ;
17
17
clearInterval ( intervalId ) ;
18
18
19
19
tabs [ currentTab ] . sliderIndex = newIndex ;
@@ -30,7 +30,7 @@ export default function mainReducer(state, action) {
30
30
if ( sliderIndex < snapshots . length - 1 ) {
31
31
const newIndex = sliderIndex + 1 ;
32
32
33
- port . postMessage ( { action : 'jumpToSnap' , payload : snapshots [ newIndex ] } ) ;
33
+ port . postMessage ( { action : 'jumpToSnap' , payload : snapshots [ newIndex ] , tabId : currentTab } ) ;
34
34
35
35
tabs [ currentTab ] . sliderIndex = newIndex ;
36
36
@@ -58,16 +58,16 @@ export default function mainReducer(state, action) {
58
58
} ;
59
59
}
60
60
case types . CHANGE_SLIDER : {
61
- port . postMessage ( { action : 'jumpToSnap' , payload : snapshots [ action . payload ] } ) ;
61
+ port . postMessage ( { action : 'jumpToSnap' , payload : snapshots [ action . payload ] , tabId : currentTab } ) ;
62
62
tabs [ currentTab ] . sliderIndex = action . payload ;
63
63
return { ...state , tabs } ;
64
64
}
65
65
case types . EMPTY : {
66
- port . postMessage ( { action : 'emptySnap' , tabd : currentTab } ) ;
66
+ port . postMessage ( { action : 'emptySnap' , tabId : currentTab } ) ;
67
67
tabs [ currentTab ] . sliderIndex = 0 ;
68
68
tabs [ currentTab ] . viewIndex = - 1 ;
69
69
tabs [ currentTab ] . playing = false ;
70
- tabs [ currentTab ] . snapshots = [ ] ;
70
+ tabs [ currentTab ] . snapshots . splice ( 1 ) ;
71
71
return {
72
72
...state ,
73
73
tabs,
@@ -77,7 +77,7 @@ export default function mainReducer(state, action) {
77
77
return { ...state , port : action . payload } ;
78
78
}
79
79
case types . IMPORT : {
80
- port . postMessage ( { action : 'import' , payload : action . payload } ) ;
80
+ port . postMessage ( { action : 'import' , payload : action . payload , tabId : currentTab } ) ;
81
81
tabs [ currentTab ] . snapshots = action . payload ;
82
82
return {
83
83
...state ,
@@ -100,7 +100,7 @@ export default function mainReducer(state, action) {
100
100
break ;
101
101
default :
102
102
}
103
- port . postMessage ( { action : actionText , payload : newMode } ) ;
103
+ port . postMessage ( { action : actionText , payload : newMode , tabId : currentTab } ) ;
104
104
return { ...state , tabs } ;
105
105
}
106
106
case types . PAUSE : {
0 commit comments