PLT-3640 Add mobile landing pages (#3674)
* PLT-3640 Moved all clientside user agent snooping into a single file * PLT-3640 Added mobile landing pages on login to iOS and Android web apps * PLT-3640 Moved landing page to appear before first login * PLT-3640 Fixed detection of Chrome on Android * PLT-3640 Disabled mobile landing pages when their respective URLs are set to blank
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
790dd91e7d
Коммит
1de3bd3b43
@@ -9,7 +9,23 @@ import claimAccountRoute from 'routes/route_claim.jsx';
|
||||
import createTeamRoute from 'routes/route_create_team.jsx';
|
||||
import teamRoute from 'routes/route_team.jsx';
|
||||
|
||||
import BrowserStore from 'stores/browser_store.jsx';
|
||||
import ErrorStore from 'stores/error_store.jsx';
|
||||
import * as UserAgent from 'utils/user_agent.jsx';
|
||||
|
||||
function preLogin(nextState, replace, callback) {
|
||||
// redirect to the mobile landing page if the user hasn't seen it before
|
||||
if (window.mm_config.IosAppDownloadLink && UserAgent.isIosWeb() && !BrowserStore.hasSeenLandingPage()) {
|
||||
replace('/get_ios_app');
|
||||
BrowserStore.setLandingPageSeen(true);
|
||||
} else if (window.mm_config.AndroidAppDownloadLink && UserAgent.isAndroidWeb() && !BrowserStore.hasSeenLandingPage()) {
|
||||
replace('/get_android_app');
|
||||
BrowserStore.setLandingPageSeen(true);
|
||||
}
|
||||
|
||||
callback();
|
||||
}
|
||||
|
||||
function preLoggedIn(nextState, replace, callback) {
|
||||
ErrorStore.clearLastError();
|
||||
callback();
|
||||
@@ -28,6 +44,7 @@ export default {
|
||||
[
|
||||
{
|
||||
path: 'login',
|
||||
onEnter: preLogin,
|
||||
getComponents: (location, callback) => {
|
||||
System.import('components/login/login_controller.jsx').then(RouteUtils.importComponentSuccess(callback));
|
||||
}
|
||||
@@ -66,6 +83,18 @@ export default {
|
||||
]
|
||||
)
|
||||
},
|
||||
{
|
||||
path: 'get_ios_app',
|
||||
getComponents: (location, callback) => {
|
||||
System.import('components/get_ios_app/get_ios_app.jsx').then(RouteUtils.importComponentSuccess(callback));
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'get_android_app',
|
||||
getComponents: (location, callback) => {
|
||||
System.import('components/get_android_app/get_android_app.jsx').then(RouteUtils.importComponentSuccess(callback));
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'error',
|
||||
getComponents: (location, callback) => {
|
||||
|
||||
Ссылка в новой задаче
Block a user