Skip to content

Commit

Permalink
refactor(INJI-449): optimize time taken to hide splash screen
Browse files Browse the repository at this point in the history
Co-authored-by: Sreenadh S <[email protected]>

Signed-off-by: Kiruthika Jeyashankar <[email protected]>
  • Loading branch information
KiruthikaJeyashankar committed Nov 23, 2023
1 parent 753b443 commit 8d64d81
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ const AppLayoutWrapper: React.FC = () => {
const isDecryptError = useSelector(appService, selectIsDecryptError);
const controller = useApp();
const {t} = useTranslation('WelcomeScreen');

useEffect(() => {
async function hideAppLoading() {
await SplashScreen.hideAsync();
}
hideAppLoading();
}, []);

if (isDecryptError) {
DecryptErrorAlert(controller, t);
}
Expand Down Expand Up @@ -117,13 +125,6 @@ const AppInitialization: React.FC = () => {
}
}, [i18n.language]);

useEffect(() => {
async function hideAppLoading() {
await SplashScreen.hideAsync();
}
if (isReady && hasFontsLoaded) hideAppLoading();
}, [isReady, hasFontsLoaded]);

return isReady && hasFontsLoaded ? (
<AppLayoutWrapper />
) : (
Expand Down

0 comments on commit 8d64d81

Please sign in to comment.