archy/neode-ui/src/utils/introSplash.ts

18 lines
490 B
TypeScript

export interface IntroSplashDecisionInput {
seenIntro: boolean
routePath: string
fromBoot: boolean
devMode?: string
onboardingComplete: boolean | null
}
export function shouldShowIntroSplash(input: IntroSplashDecisionInput): boolean {
if (input.seenIntro) return false
if (input.onboardingComplete === true) return false
const isDirectRoute = input.routePath !== '/'
if (input.fromBoot) return true
if (input.devMode === 'boot') return false
return !isDirectRoute
}