-
Notifications
You must be signed in to change notification settings - Fork 392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CB-4401 feat: save value panel state per column #2272
Conversation
setCurrentTabId(firstTabId); | ||
lastTabId.current = firstTabId; | ||
} | ||
if (displayed.length > 0 && (!currentTabId || !displayed.some(tab => tab.key === currentTabId))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const hasCurrentTabCells = currentTabId && displayed.some(tab => tab.key === currentTabId)
if (displayed.length > 0 && !hasCurrentTabCells)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, changed
@@ -166,27 +161,40 @@ export const TextValuePresentation: TabContainerPanelComponent<IDataValuePanelPr | |||
} | |||
} | |||
|
|||
let currentContentType = state.currentContentType; | |||
|
|||
if (activeTabs.length > 0 && !activeTabs.some(tab => tab.key === currentContentType)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for first condition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually needed because some() acts like the "there exists" quantifier in mathematics. In particular, for an empty array, it returns false for any condition.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
No description provided.