Skip to content

Commit 452b0bd

Browse files
committed
fix: sitemap sidebar exclude button from uncorrectly not showing
1 parent b5d774b commit 452b0bd

File tree

1 file changed

+9
-2
lines changed
  • packages/addons/sitemap/admin/components/EditView

1 file changed

+9
-2
lines changed

packages/addons/sitemap/admin/components/EditView/index.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ const CMEditViewExclude = () => {
3131
// eslint-disable-next-line react-hooks/exhaustive-deps
3232
}, []);
3333

34-
if (!sitemapSettings.contentTypes) return null;
35-
if (!sitemapSettings.contentTypes[props.slug]) return null;
34+
const isContentTypeInAnySitemap = () => {
35+
if (!sitemapSettings.sitemaps) return false;
36+
37+
return Object.values(sitemapSettings.sitemaps).some(
38+
(sitemap) => sitemap.contentTypes && sitemap.contentTypes[props.slug],
39+
);
40+
};
41+
42+
if (!isContentTypeInAnySitemap()) return null;
3643

3744
const excluded = 'sitemap_exclude' in values ? values.sitemap_exclude : document?.sitemap_exclude;
3845

0 commit comments

Comments
 (0)