Skip to content

Commit c393a95

Browse files
authored
Merge pull request #1308 from prezly/feature/dev-20625-we-are-not-showing-other-rooms-on-the-site
[DEV-20625] Fix - Count included sites after filtering them
2 parents 275d0eb + 570d9c6 commit c393a95

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

next.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ const moduleExports = withBundleAnalyzer(
2424
prependData: globalSassImports,
2525
},
2626
eslint: {
27-
dirs: [
28-
'src',
29-
'custom',
30-
],
27+
dirs: ['src', 'custom'],
3128
},
3229
webpack(config) {
3330
config.module.rules.push({

src/modules/InfiniteHubStories/InfiniteHubStories.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function InfiniteHubStories({
5353
}: Props) {
5454
const locale = useLocale();
5555
const { formatMessage } = useIntl();
56+
const includedNewsrooms = newsrooms.filter(({ uuid }) => uuid !== newsroomUuid);
5657

5758
const { load, loading, data, done } = useInfiniteLoading(
5859
useCallback(
@@ -69,12 +70,10 @@ export function InfiniteHubStories({
6970

7071
return (
7172
<div>
72-
<div className={styles.newsrooms} data-count={newsrooms.length}>
73-
{newsrooms
74-
.filter(({ uuid }) => uuid !== newsroomUuid)
75-
.map((newsroom) => (
76-
<NewsroomLogo key={newsroom.uuid} newsroom={newsroom} />
77-
))}
73+
<div className={styles.newsrooms} data-count={includedNewsrooms.length}>
74+
{includedNewsrooms.map((newsroom) => (
75+
<NewsroomLogo key={newsroom.uuid} newsroom={newsroom} />
76+
))}
7877
</div>
7978
{data.length > 0 && (
8079
<PageTitle

0 commit comments

Comments
 (0)