Skip to content

Commit

Permalink
updated timing for when to hide the splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Rowe committed Aug 1, 2021
1 parent c749850 commit 9db963c
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 24 deletions.
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-local-notifications')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':capacitor-storage')

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/assets/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cordova": {},
"plugins": {
"SplashScreen": {
"launchShowDuration": 1500
"launchAutoHide": false
},
"LocalNotifications": {
"smallIcon": "ic_launcher"
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"pkg": "@capacitor/local-notifications",
"classpath": "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin"
},
{
"pkg": "@capacitor/splash-screen",
"classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin"
},
{
"pkg": "@capacitor/status-bar",
"classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor
include ':capacitor-local-notifications'
project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android')

include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')

include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

Expand Down
2 changes: 1 addition & 1 deletion capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cordova": {},
"plugins": {
"SplashScreen": {
"launchShowDuration": 1500
"launchAutoHide": false
},
"LocalNotifications": {
"smallIcon": "ic_launcher"
Expand Down
58 changes: 39 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
},
"homepage": ".",
"dependencies": {
"@apollo/client": "^3.3.21",
"@apollo/client": "^3.4.1",
"@capacitor/android": "^3.1.2",
"@capacitor/app": "^1.0.2",
"@capacitor/core": "^3.1.2",
"@capacitor/haptics": "^1.0.2",
"@capacitor/keyboard": "^1.0.2",
"@capacitor/local-notifications": "^1.0.3",
"@capacitor/splash-screen": "^1.1.0",
"@capacitor/status-bar": "^1.0.2",
"@capacitor/storage": "^1.0.3",
"@hookform/resolvers": "^2.6.1",
"@hookform/resolvers": "^2.7.0",
"@ionic/react": "5.6.12",
"@ionic/react-router": "5.6.12",
"clsx": "^1.1.1",
Expand All @@ -47,7 +48,7 @@
"react": "^17.0.2",
"react-animate-height": "^2.0.23",
"react-dom": "^17.0.2",
"react-hook-form": "^7.12.1",
"react-hook-form": "^7.12.2",
"react-jss": "^10.7.1",
"react-minimal-pie-chart": "^8.2.0",
"react-router": "^5.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/modules/authentication/hooks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useCallback, useContext, useEffect } from 'react'
import { useApolloClient, useQuery } from '@apollo/client'
import { useHistory } from 'react-router-dom'
import { SplashScreen } from '@capacitor/splash-screen'

import { AuthContext } from './context'
import { useAuthReducer } from './reducer'
Expand Down Expand Up @@ -31,6 +32,7 @@ export const useInitializeAuth = () => {
return
}
dispatch({ type: 'SUCCESSFUL_LOGIN', payload: user })
SplashScreen.hide()
history.replace(routes.home)
} catch (err) {
console.log(err)
Expand Down

0 comments on commit 9db963c

Please sign in to comment.