Skip to content

Commit

Permalink
refactor: simplifying method to generate perspective list state
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanl17 committed Dec 11, 2024
1 parent 886ccf7 commit fd9d30e
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const DocumentPerspectiveList = memo(function DocumentPerspectiveList() {
return !editState?.published
}, [editState?.liveEdit, editState?.published])

const getIsReleaseSelected = useCallback(
const getReleaseChipState = useCallback(
(release: ReleaseDocument): {selected: boolean; disabled?: boolean} => {
if (!params?.historyVersion)
return {selected: release.name === getVersionFromId(displayed?._id || '')}
Expand Down Expand Up @@ -243,9 +243,7 @@ export const DocumentPerspectiveList = memo(function DocumentPerspectiveList() {
<VersionChip
key={release._id}
tooltipContent={<TooltipContent release={release} />}
{...getIsReleaseSelected(release)}
// selected
// disabled={false}
{...getReleaseChipState(release)}
onClick={handleBundleChange(release.name)}
text={release.metadata.title || t('release.placeholder-untitled-release')}
tone={getReleaseTone(release)}
Expand Down

0 comments on commit fd9d30e

Please sign in to comment.