diff --git a/app/init/launch.ts b/app/init/launch.ts index 52326aa13..017574007 100644 --- a/app/init/launch.ts +++ b/app/init/launch.ts @@ -104,7 +104,7 @@ const launchApp = async (props: LaunchProps, resetNavigation = true) => { // redirect to the sign in // return launchToOnboarding(props, goToLoginPage); // } - + console.log('\n\n first launch to onboarding \n\n', serverUrl); return launchToOnboarding(props, resetNavigation, false, false, true, serverUrl); let launchType = props.launchType; @@ -139,7 +139,7 @@ const launchApp = async (props: LaunchProps, resetNavigation = true) => { // if (onboardingAlreadyShown) { // // launchToServer(props, resetNavigation); // } - + console.log('\n\n second launch to onboarding \n\n', serverUrl); return launchToOnboarding(props, resetNavigation); }; @@ -209,7 +209,7 @@ const launchToOnboarding = ( } // if there is not an active session, pass the prop and redirect to the LOGIN page (keep in mind all the redirection login to check for SSO stuff) - return resetToOnboarding(props, goToLogIn); + return resetToOnboarding(props, true, serverUrl); }; export const relaunchApp = (props: LaunchProps, resetNavigation = false) => { diff --git a/app/screens/navigation.ts b/app/screens/navigation.ts index 2bb7cd916..680406507 100644 --- a/app/screens/navigation.ts +++ b/app/screens/navigation.ts @@ -281,7 +281,7 @@ export function resetToSelectServer(passProps: LaunchProps) { }); } -export function resetToOnboarding(passProps: LaunchProps, goToLogIn: boolean) { +export function resetToOnboarding(passProps: LaunchProps, goToLogIn: boolean, serverUrl: string) { const theme = getDefaultThemeByAppearance(); const isDark = tinyColor(theme.sidebarBg).isDark(); StatusBar.setBarStyle(isDark ? 'light-content' : 'dark-content'); @@ -296,6 +296,7 @@ export function resetToOnboarding(passProps: LaunchProps, goToLogIn: boolean) { ...passProps, theme, goToLogIn, + serverUrl, }, options: { layout: { diff --git a/app/screens/onboarding/index.tsx b/app/screens/onboarding/index.tsx index a1611ede4..12a4b9e9f 100644 --- a/app/screens/onboarding/index.tsx +++ b/app/screens/onboarding/index.tsx @@ -5,7 +5,9 @@ import React, {useCallback, useEffect, useRef} from 'react'; import {View, ListRenderItemInfo, useWindowDimensions, SafeAreaView, ScrollView, Animated as AnimatedRN} from 'react-native'; import Animated, {Easing, useAnimatedRef, useAnimatedScrollHandler, useDerivedValue, useSharedValue} from 'react-native-reanimated'; +import {fetchConfigAndLicense} from '@actions/remote/systems'; import {Screens} from '@app/constants'; +import {loginOptions} from '@app/utils/server'; import Background from '@screens/background'; import {goToScreen, loginAnimationOptions} from '@screens/navigation'; import {makeStyleSheetFromTheme} from '@utils/theme'; @@ -16,9 +18,6 @@ import SlideItem from './slide'; import useSlidesData, {OnboardingItem} from './slides_data'; import type {LaunchProps} from '@typings/launch'; -import { loginOptions } from '@app/utils/server'; -import { fetchConfigAndLicense } from '@actions/remote/systems'; -import { queryServerByIdentifier } from '@app/queries/app/servers'; interface OnboardingProps extends LaunchProps { theme: Theme; @@ -84,12 +83,10 @@ const Onboarding = ({ const displayLogin = (config: ClientConfig, license: ClientLicense) => { const {enabledSSOs, hasLoginForm, numberSSOs, ssoOptions} = loginOptions(config, license); + const displayName = 'displayName'; const passProps = { config, - extra, hasLoginForm, - launchError, - launchType, license, serverDisplayName: displayName, serverUrl,