diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle index 205fa95..0b1ab70 100644 --- a/android/app/capacitor.build.gradle +++ b/android/app/capacitor.build.gradle @@ -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') diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index bd4fc04..86d0447 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -7,7 +7,7 @@ "cordova": {}, "plugins": { "SplashScreen": { - "launchShowDuration": 1500 + "launchAutoHide": false }, "LocalNotifications": { "smallIcon": "ic_launcher" diff --git a/android/app/src/main/assets/capacitor.plugins.json b/android/app/src/main/assets/capacitor.plugins.json index b0bd0ad..4d15662 100644 --- a/android/app/src/main/assets/capacitor.plugins.json +++ b/android/app/src/main/assets/capacitor.plugins.json @@ -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" diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle index 1d071c2..6e17adb 100644 --- a/android/capacitor.settings.gradle +++ b/android/capacitor.settings.gradle @@ -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') diff --git a/capacitor.config.json b/capacitor.config.json index 308592e..a683ef9 100644 --- a/capacitor.config.json +++ b/capacitor.config.json @@ -7,7 +7,7 @@ "cordova": {}, "plugins": { "SplashScreen": { - "launchShowDuration": 1500 + "launchAutoHide": false }, "LocalNotifications": { "smallIcon": "ic_launcher" diff --git a/package-lock.json b/package-lock.json index 2b56c81..403b0b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,23 +5,29 @@ "requires": true, "dependencies": { "@apollo/client": { - "version": "3.3.21", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.3.21.tgz", - "integrity": "sha512-RAmZReFuKCKx0Rs5C0nVJwKomAHUHn+gGP/YvbEsXQWu0sXoncEUZa71UqlfCPVXa/0MkYOIbCXSQdOcuRrHgw==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.4.1.tgz", + "integrity": "sha512-CT7ZBSHQD4UG1PDvMS9qOz5ACRIR0b4mBkqjCXEVjteOxA4wpFqUX3dg2bNl+Ok3LwPxFT4b3FwC3+LVcWFa6w==", "requires": { "@graphql-typed-document-node/core": "^3.0.0", - "@types/zen-observable": "^0.8.0", "@wry/context": "^0.6.0", "@wry/equality": "^0.5.0", - "fast-json-stable-stringify": "^2.0.0", - "graphql-tag": "^2.12.0", + "@wry/trie": "^0.3.0", + "graphql-tag": "^2.12.3", "hoist-non-react-statics": "^3.3.2", - "optimism": "^0.16.0", + "optimism": "^0.16.1", "prop-types": "^15.7.2", "symbol-observable": "^4.0.0", - "ts-invariant": "^0.8.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.14" + "ts-invariant": "^0.9.0", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.1.0" + }, + "dependencies": { + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + } } }, "@babel/code-frame": { @@ -1288,6 +1294,11 @@ "resolved": "https://registry.npmjs.org/@capacitor/local-notifications/-/local-notifications-1.0.3.tgz", "integrity": "sha512-yr9FXP8U83ULKAl+AZYtYs/azxJDqM0AxVdoZ8t1nTqfsFqrYTXTFCg7eSLx05LbNVYGzPlt5C0JtLsOFzKqIA==" }, + "@capacitor/splash-screen": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@capacitor/splash-screen/-/splash-screen-1.1.0.tgz", + "integrity": "sha512-DJ7TiWtfe84NFYdxuvw1etVhVoZgJp5jggOa6hXcADshhNi3XjPXI8CKnuhmmgHmV7gmwV9SFmSX2TtGf4tyAw==" + }, "@capacitor/status-bar": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-1.0.2.tgz", @@ -1401,9 +1412,9 @@ } }, "@hookform/resolvers": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-2.6.1.tgz", - "integrity": "sha512-7tml6bUUzdkk7tYb5LBk4i6ctV/1Rs4U5qVxrNBXZd8ZhxvsELI0TyYrnCK0XSlCo8Htlat8TOzxSZcKWOH5KQ==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-2.7.0.tgz", + "integrity": "sha512-uWKw0hSFiljLmNe4FR/k6bZ/dp7xvZG9CAXFUM24E7CunGhU5Ltvu6KUrkNDOKsoIrpc01pQsQ1Sjim1P6FaAg==" }, "@ionic/cli-framework-output": { "version": "2.2.2", @@ -13293,9 +13304,9 @@ "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" }, "react-hook-form": { - "version": "7.12.1", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.12.1.tgz", - "integrity": "sha512-JBu5TZK3IXzDKw9SuNFwyQFdIx5uGZSmN9QTDsNsDSYdccU/O+43jBUh0zKG4jDc4hiNYYgDw34lLt7qLSeusA==" + "version": "7.12.2", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.12.2.tgz", + "integrity": "sha512-cpxocjrgpMAJCMJQR51BQhMoEx80/EQqePNihMTgoTYTqCRbd2GExi+N4GJIr+cFqrmbwNj9wxk5oLWYQsUefg==" }, "react-is": { "version": "16.13.1", @@ -15601,9 +15612,9 @@ "integrity": "sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ==" }, "ts-invariant": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.8.2.tgz", - "integrity": "sha512-VI1ZSMW8soizP5dU8DsMbj/TncHf7bIUqavuE7FTeYeQat454HHurJ8wbfCnVWcDOMkyiBUWOW2ytew3xUxlRw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.9.0.tgz", + "integrity": "sha512-+JqhKqywk+ue5JjAC6eTWe57mOIxYXypMUkBDStkAzvnlfkDJ1KGyeMuNRMwOt6GXzHSC1UT9JecowpZDmgXqA==", "requires": { "tslib": "^2.1.0" }, @@ -17533,6 +17544,15 @@ "version": "0.8.15", "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" + }, + "zen-observable-ts": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.1.0.tgz", + "integrity": "sha512-1h4zlLSqI2cRLPJUHJFL8bCWHhkpuXkF+dbGkRaWjgDIG26DmzyshUMrdV/rL3UnR+mhaX4fRq8LPouq0MYYIA==", + "requires": { + "@types/zen-observable": "0.8.3", + "zen-observable": "0.8.15" + } } } } diff --git a/package.json b/package.json index 62a9a64..75a008f 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/src/modules/authentication/hooks.js b/src/modules/authentication/hooks.js index 1af4f93..7400945 100644 --- a/src/modules/authentication/hooks.js +++ b/src/modules/authentication/hooks.js @@ -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' @@ -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)