Skip to content

Commit 22670dd

Browse files
committed
jumping now moves slider and jumping no longer changes state container
1 parent 7fd71a3 commit 22670dd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/app/components/Action.jsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ const Action = (props) => {
1414
<div className="action-component-text">{index}</div>
1515
<div
1616
className="jump-button"
17-
onClick={() => handleJumpSnapshot(index)}
17+
onClick={(e) => {
18+
e.stopPropagation();
19+
handleJumpSnapshot(index);
20+
}}
1821
tabIndex={index}
1922
role="button"
2023
>
@@ -24,9 +27,11 @@ const Action = (props) => {
2427
);
2528
};
2629

27-
// Action.propTypes = {
28-
// selected: PropTypes.bool,
29-
// index: PropTypes.number,
30-
// };
30+
Action.propTypes = {
31+
selected: PropTypes.bool.isRequired,
32+
index: PropTypes.number.isRequired,
33+
handleChangeSnapshot: PropTypes.func.isRequired,
34+
handleJumpSnapshot: PropTypes.func.isRequired,
35+
};
3136

3237
export default Action;

src/app/containers/MainContainer.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,14 @@ class MainContainer extends Component {
4040
const { action, payload } = message;
4141
switch (action) {
4242
case 'sendSnapshots': {
43-
const viewIndex = payload.length - 1;
44-
const sliderIndex = viewIndex;
43+
const sliderIndex = payload.length - 1;
4544
// set state with the information received from the background script
46-
this.setState({ snapshots: payload, viewIndex, sliderIndex });
45+
this.setState({ snapshots: payload, sliderIndex });
4746
break;
4847
}
4948
case 'initialConnectSnapshots': {
5049
const { snapshots, mode } = payload;
51-
const viewIndex = snapshots.length - 1;
50+
const viewIndex = 0;
5251
const sliderIndex = viewIndex;
5352
this.setState({ snapshots, mode, viewIndex, sliderIndex });
5453
break;

0 commit comments

Comments
 (0)