Skip to content

Commit 8a9acfd

Browse files
authored
Merge pull request #89 from oslabs-beta/rydang/deletetab
fixed deletedTab bug
2 parents 544bf1f + 2fd40b1 commit 8a9acfd

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-time-travel",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "A library that helps debug React by memorizing the state of components with every render.",
55
"main": "index.js",
66
"repository": {

src/app/reducers/mainReducer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ export default (state, action) => produce(state, draft => {
143143
}
144144
});
145145

146+
// only set first tab if current tab is non existent
147+
const firstTab = parseInt(Object.keys(payload)[0], 10);
148+
draft.currentTab = currentTab === null ? firstTab : currentTab;
149+
146150
break;
147151
}
148152
case types.SET_TAB: {

0 commit comments

Comments
 (0)