diff --git a/src/actions/RouterActions.js b/src/actions/RouterActions.js index c5cd20c1..e47a72d8 100644 --- a/src/actions/RouterActions.js +++ b/src/actions/RouterActions.js @@ -152,7 +152,8 @@ export const getValidUrl = (action: RouterAction): PayloadAction => (dis const shouldBeLandingPage = getState().devices.length < 1 || !getState().wallet.ready || getState().connect.error !== null; const landingPageUrl = dispatch(isLandingPageUrl(requestedUrl)); if (shouldBeLandingPage) { - return !landingPageUrl ? '/' : requestedUrl; + const landingPageRoute = dispatch(isLandingPageUrl(requestedUrl, true)); + return !landingPageRoute ? '/' : requestedUrl; } // Disallow displaying landing page @@ -283,11 +284,17 @@ const goto = (url: string): ThunkAction => (dispatch: Dispatch, getState: GetSta /* * Check if requested OR current url is landing page */ -export const isLandingPageUrl = ($url?: string): PayloadAction => (dispatch: Dispatch, getState: GetState): boolean => { +export const isLandingPageUrl = ($url?: string, checkRoutes: boolean = false): PayloadAction => (dispatch: Dispatch, getState: GetState): boolean => { let url: ?string = $url; if (typeof url !== 'string') { url = getState().router.location.pathname; } + if (checkRoutes) { + const isLandingRoute = routes.find(r => r.pattern === url && r.name.indexOf('landing') >= 0); + if (isLandingRoute) { + return true; + } + } return url === '/'; }; @@ -334,7 +341,7 @@ export const gotoFirmwareUpdate = (): ThunkAction => (dispatch: Dispatch, getSta */ export const setInitialUrl = (): PayloadAction => (dispatch: Dispatch, getState: GetState): boolean => { const { initialPathname } = getState().wallet; - if (typeof initialPathname === 'string' && !dispatch(isLandingPageUrl(initialPathname))) { + if (typeof initialPathname === 'string' && !dispatch(isLandingPageUrl(initialPathname, true))) { const valid = dispatch(getValidUrl({ type: LOCATION_CHANGE, payload: { diff --git a/src/views/Landing/components/InstallBridge/index.js b/src/views/Landing/components/InstallBridge/index.js index a53704ff..3f1a1703 100644 --- a/src/views/Landing/components/InstallBridge/index.js +++ b/src/views/Landing/components/InstallBridge/index.js @@ -131,7 +131,7 @@ class InstallBridge extends Component { const currentTarget: ?InstallTarget = installers.find(i => i.preferred === true); this.state = { - currentVersion: props.transport.type ? `Your version ${props.transport.version}` : 'Not installed', + currentVersion: props.transport.type && props.transport.type === 'bridge' ? `Your version ${props.transport.version}` : 'Not installed', latestVersion: props.transport.bridge.version.join('.'), installers, target: currentTarget || installers[0], diff --git a/src/views/Landing/index.js b/src/views/Landing/index.js index 7c6ea3e9..3dbf8174 100644 --- a/src/views/Landing/index.js +++ b/src/views/Landing/index.js @@ -106,7 +106,7 @@ export default (props: Props) => { {shouldShowUnsupportedBrowser && } {shouldShowInstallBridge && } - {(shouldShowConnectDevice || shouldShowDisconnectDevice) && ( + {!shouldShowInstallBridge && (shouldShowConnectDevice || shouldShowDisconnectDevice) && (

The private bank in your hands.