|
|
|
@ -10,9 +10,9 @@ import {ScreenLayout, colors, RouteKey} from '../../shared';
@@ -10,9 +10,9 @@ import {ScreenLayout, colors, RouteKey} from '../../shared';
|
|
|
|
|
import AsyncStorage from '@react-native-async-storage/async-storage'; |
|
|
|
|
import {useNavigation, CommonActions} from '@react-navigation/native'; |
|
|
|
|
import {StorageKey, storageService} from '../../services/async-storage.service'; |
|
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
import { useAppDispatch } from '../../../store/hooks'; |
|
|
|
|
import { fetchPostsAsync } from '../../services/game-items/game-items-slice'; |
|
|
|
|
import {useTranslation} from 'react-i18next'; |
|
|
|
|
import {useAppDispatch} from '../../../store/hooks'; |
|
|
|
|
import {fetchPostsAsync} from '../../services/game-items/game-items-slice'; |
|
|
|
|
|
|
|
|
|
export const LoadingScreen = () => { |
|
|
|
|
const {i18n} = useTranslation(); |
|
|
|
@ -35,25 +35,36 @@ export const LoadingScreen = () => {
@@ -35,25 +35,36 @@ export const LoadingScreen = () => {
|
|
|
|
|
const isOnBoard = await getOnboardEnd(); |
|
|
|
|
dispatch(fetchPostsAsync()); |
|
|
|
|
|
|
|
|
|
console.log(language); |
|
|
|
|
|
|
|
|
|
if (language) { |
|
|
|
|
i18n.changeLanguage(language); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isOnBoard && language) { |
|
|
|
|
navigate.navigate(RouteKey.Game as any); |
|
|
|
|
navigate.dispatch( |
|
|
|
|
CommonActions.reset({ |
|
|
|
|
index: 0, |
|
|
|
|
routes: [{name: RouteKey.Game}], |
|
|
|
|
}), |
|
|
|
|
); |
|
|
|
|
} else if (language && !isOnBoard) { |
|
|
|
|
navigate.navigate(RouteKey.Onboarding as any); |
|
|
|
|
navigate.dispatch( |
|
|
|
|
CommonActions.reset({ |
|
|
|
|
index: 0, |
|
|
|
|
routes: [{name: RouteKey.Onboarding}], |
|
|
|
|
}), |
|
|
|
|
); |
|
|
|
|
} else if (!language) { |
|
|
|
|
navigate.navigate(RouteKey.LanguageSelect as any); |
|
|
|
|
navigate.dispatch( |
|
|
|
|
CommonActions.reset({ |
|
|
|
|
index: 0, |
|
|
|
|
routes: [{name: RouteKey.LanguageSelect}], |
|
|
|
|
}), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
navigate.dispatch(CommonActions.reset({ |
|
|
|
|
index: 0, |
|
|
|
|
routes: [{name: RouteKey.Game}] |
|
|
|
|
})); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
init(); |
|
|
|
|
}, []); |
|
|
|
|