Skip to content

Commit 410d385

Browse files
committed
Fix #5514
1 parent 9e78fad commit 410d385

File tree

1 file changed

+12
-12
lines changed
  • src/shared/components/Contentful/Tabs

1 file changed

+12
-12
lines changed

src/shared/components/Contentful/Tabs/Tabs.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ export default class TabsItemsLoader extends Component {
5252
const q = getQuery();
5353
const { tabId } = this.props;
5454
const { tabIndex } = this.state;
55-
if (q.tabs && q.tabs[tabId] && Number(q.tabs[tabId]) !== tabIndex) {
56-
this.setState({ tabIndex: Number(q.tabs[tabId]) });
57-
} else {
58-
this.updatePageUrl();
55+
if (q.tracks && q.tracks[tabId] && Number(q.tracks[tabId]) !== tabIndex) {
56+
this.setState({ tabIndex: Number(q.tracks[tabId]) });
5957
}
6058
}
6159

@@ -64,14 +62,16 @@ export default class TabsItemsLoader extends Component {
6462
}
6563

6664
updatePageUrl() {
67-
const q = getQuery();
68-
const { tabId } = this.props;
69-
const { tabIndex } = this.state;
70-
updateQuery({
71-
tabs: {
72-
...q.tabs,
73-
[tabId]: tabIndex || 0,
74-
},
65+
this.setState((state) => {
66+
const q = getQuery();
67+
const { tabId } = this.props;
68+
const { tabIndex } = state;
69+
updateQuery({
70+
tabs: {
71+
...q.tracks,
72+
[tabId]: tabIndex || 0,
73+
},
74+
});
7575
});
7676
}
7777

0 commit comments

Comments
 (0)