diff --git a/apps/sim/app/(landing)/components/navbar/components/github-stars.tsx b/apps/sim/app/(landing)/components/navbar/components/github-stars.tsx index e4031719b2..a8aafdc45a 100644 --- a/apps/sim/app/(landing)/components/navbar/components/github-stars.tsx +++ b/apps/sim/app/(landing)/components/navbar/components/github-stars.tsx @@ -7,7 +7,7 @@ import { getFormattedGitHubStars } from '@/app/(landing)/actions/github' const logger = createLogger('github-stars') -const INITIAL_STARS = '27.6k' +const INITIAL_STARS = '27.7k' /** * Client component that displays GitHub stars count. diff --git a/apps/sim/app/(landing)/components/navbar/navbar.tsx b/apps/sim/app/(landing)/components/navbar/navbar.tsx index 7e8d734261..54579bc173 100644 --- a/apps/sim/app/(landing)/components/navbar/navbar.tsx +++ b/apps/sim/app/(landing)/components/navbar/navbar.tsx @@ -1,6 +1,6 @@ 'use client' -import { useCallback, useEffect, useRef, useState } from 'react' +import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react' import Image from 'next/image' import Link from 'next/link' import { useSearchParams } from 'next/navigation' @@ -38,6 +38,8 @@ const NAV_LINKS: NavLink[] = [ const LOGO_CELL = 'flex items-center pl-5 lg:pl-16 pr-5' const LINK_CELL = 'flex items-center px-3.5' +const emptySubscribe = () => () => {} + interface NavbarProps { logoOnly?: boolean blogPosts?: NavBlogPost[] @@ -51,6 +53,12 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps const isBrowsingHome = searchParams.has('home') const useHomeLinks = isAuthenticated || isBrowsingHome const logoHref = useHomeLinks ? '/?home' : '/' + const mounted = useSyncExternalStore( + emptySubscribe, + () => true, + () => false + ) + const shouldShow = mounted && !isSessionPending const [activeDropdown, setActiveDropdown] = useState(null) const [mobileMenuOpen, setMobileMenuOpen] = useState(false) const closeTimerRef = useRef | null>(null) @@ -206,9 +214,11 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps
{isAuthenticated ? ( @@ -326,7 +336,12 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps
{isAuthenticated ? (