Skip to content

Commit

Permalink
Merge pull request #219 from scott-klaytn/fix-rating-system
Browse files Browse the repository at this point in the history
Fix unintended appearance of rating button
  • Loading branch information
scott-klaytn authored Jan 24, 2025
2 parents bb4a83c + 67bd8b2 commit e549b16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/theme/Footer/Rating/Rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export default function FeelbackRating() {
const containerRef = useRef(null);

useEffect(() => {
if (typeof window === 'undefined' || location.pathname === '/') {
// Uses a regex pattern to detect both root ('/') and localized ('/zh-CN/', '/vi/', etc.) homepages
const isHomePage = location.pathname === '/' || /^\/([\w-]+)?\/$/.test(location.pathname);
if (typeof window === 'undefined' || isHomePage) {
return;
}

Expand Down

0 comments on commit e549b16

Please sign in to comment.