diff --git a/frontend/app/components/Session_/Storage/Storage.js b/frontend/app/components/Session_/Storage/Storage.js index ac9a0ec48..add061001 100644 --- a/frontend/app/components/Session_/Storage/Storage.js +++ b/frontend/app/components/Session_/Storage/Storage.js @@ -48,7 +48,6 @@ function getActionsName(type) { //@withEnumToggle('activeTab', 'setActiveTab', DIFF) export default class Storage extends React.PureComponent { lastBtnRef = React.createRef(); - state = { showDiffs: false }; focusNextButton() { if (this.lastBtnRef.current) { @@ -130,8 +129,8 @@ export default class Storage extends React.PureComponent { return ; } - renderItem(item, i, prevItem) { - const { type, listNow, list } = this.props; + renderItem(item, i, prevItem, listNowLen, listLen) { + const { type } = this.props; let src; let name; @@ -154,10 +153,6 @@ export default class Storage extends React.PureComponent { name = item.mutation.join(''); } - if (src !== null && !this.state.showDiffs) { - this.setState({ showDiffs: true }) - } - return (
{formatMs(item.duration)}
)}
- {i + 1 < listNow.length && ( + {i + 1 < listNowLen && ( )} - {i + 1 === listNow.length && i + 1 < list.length && ( + {i + 1 === listNowLen && i + 1 < listLen && ( @@ -205,13 +200,15 @@ export default class Storage extends React.PureComponent { const { type, listNow, list, hintIsHidden } = this.props; const showStore = type !== STORAGE_TYPES.MOBX; + const listNowLen = listNow.length + const listLen = list.length return ( {list.length > 0 && (
{showStore &&

{'STATE'}

} - {this.state.showDiffs ? ( + {type !== STORAGE_TYPES.ZUSTAND ? (

DIFFS

@@ -307,7 +304,7 @@ export default class Storage extends React.PureComponent {
{listNow.map((item, i) => - this.renderItem(item, i, i > 0 ? listNow[i - 1] : undefined) + this.renderItem(item, i, i > 0 ? listNow[i - 1] : undefined, listNowLen, listLen) )}