Skip to content

Commit 2fd40b1

Browse files
committed
fixed deletedTab bug
1 parent 01eba9e commit 2fd40b1

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
@@ -141,6 +141,10 @@ export default (state, action) => produce(state, draft => {
141141
};
142142
});
143143

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

0 commit comments

Comments
 (0)