diff --git a/config/webpack.config.cozy-home.js b/config/webpack.config.cozy-home.js index f28da29ef1..8989c9326c 100644 --- a/config/webpack.config.cozy-home.js +++ b/config/webpack.config.cozy-home.js @@ -88,6 +88,10 @@ module.exports = { /WebVaultClient/, // EEFLongWordList /cozy-ui\/transpiled\/react\/Portal\/index\.js/ // preact-portal ] + }), + + new webpack.DefinePlugin({ + __SIMULATE_FLAGSHIP__: true }) ].filter(Boolean) } diff --git a/docs/develop.md b/docs/develop.md index 89ab261046..e18c584e21 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -14,3 +14,7 @@ $ yarn start ``` [setup]: https://docs.cozy.io/en/tutorials/app/#install-the-development-environment "Cozy dev docs: Set up the Development Environment" + +### Flagship mode + +If you want to simulate flagship environment, you can edit the `__SIMULATE_FLAGSHIP__` var in the `webpack.config.cozy-home.js`. It'll simulate a splashscreen during the loading of the application and simulate a call to `hideSplashscreen`. \ No newline at end of file diff --git a/src/containers/App.jsx b/src/containers/App.jsx index 23d812d563..19ec99425c 100644 --- a/src/containers/App.jsx +++ b/src/containers/App.jsx @@ -1,3 +1,4 @@ +/* global __SIMULATE_FLAGSHIP__ */ import React, { useEffect, useState } from 'react' import { Navigate, Route, Routes } from 'react-router-dom' @@ -119,6 +120,9 @@ const App = ({ accounts, konnectors, triggers }) => { webviewIntent.call('setTheme', theme) webviewIntent.call('hideSplashScreen') } + if (isReady && !webviewIntent && __SIMULATE_FLAGSHIP__) { + document.getElementById('splashscreen').style.display = 'none' + } }, [isReady, theme, webviewIntent]) return ( diff --git a/src/targets/browser/index.ejs b/src/targets/browser/index.ejs index 3b65d8acbf..39d5021aca 100644 --- a/src/targets/browser/index.ejs +++ b/src/targets/browser/index.ejs @@ -22,7 +22,10 @@ {{.ThemeCSS}} -
+ + <% if (__SIMULATE_FLAGSHIP__) { %> +