Skip to content

Commit

Permalink
perf(pci-block-storage): add join in useMemo
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Chaumet <[email protected]>
  • Loading branch information
SimonChaumet committed Oct 30, 2024
1 parent dc99da8 commit 0b24eaa
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Banner() {
const { projectId } = useParams();
const { data: availableVolumes } = useProjectsAvailableVolumes(projectId);

const regions = useMemo(
const regionsString = useMemo(
() =>
availableVolumes
? [
Expand All @@ -31,8 +31,8 @@ function Banner() {
.flatMap((p) => p.regions)
.map((r) => r.name),
),
]
: [],
].join(', ')
: '',
[availableVolumes],
);

Expand All @@ -46,7 +46,7 @@ function Banner() {
hue={ODS_TEXT_COLOR_HUE._700}
>
{t('exten_banner_description', {
regions: regions.join(', '),
regions: regionsString,
})}
</OsdsText>
</OsdsMessage>
Expand Down

0 comments on commit 0b24eaa

Please sign in to comment.