Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

661 B
Raw Blame
import { usePreferences } from "@editor/contexts/PreferencesContext";
import { useAuth } from "@editor/auth/UseSession";
import { useIsMobile } from "@editor/hooks/useIsMobile";

export function useShouldShowWelcomeModal(): boolean {
  const { preferences } = usePreferences();
  const { session, loading } = useAuth();
  const isMobile = useIsMobile();

  // Only show welcome modal if user is authenticated (session exists)
  // This prevents the modal from showing on login screens when security is enabled
  return (
    !loading &&
    !preferences.hasCompletedOnboarding &&
    preferences.toolPanelModePromptSeen &&
    !isMobile &&
    !!session
  );
}