|
|
|
@ -2,15 +2,24 @@
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import Notification from 'components/Notification';
|
|
|
|
|
import l10nCommonMessages from 'views/common.messages';
|
|
|
|
|
import { withRouter } from 'react-router-dom';
|
|
|
|
|
import { matchPath } from 'react-router';
|
|
|
|
|
import { getPattern } from 'support/routes';
|
|
|
|
|
import type { Props } from '../../index';
|
|
|
|
|
|
|
|
|
|
import l10nMessages from './index.messages';
|
|
|
|
|
|
|
|
|
|
export default (props: Props) => {
|
|
|
|
|
export default withRouter((props: Props & { location: any }) => {
|
|
|
|
|
const { selectedDevice } = props.wallet;
|
|
|
|
|
const outdated =
|
|
|
|
|
selectedDevice && selectedDevice.features && selectedDevice.firmware === 'outdated';
|
|
|
|
|
|
|
|
|
|
if (!outdated) return null;
|
|
|
|
|
|
|
|
|
|
// don't show notification when user is on firmware update page
|
|
|
|
|
if (matchPath(props.location.pathname, { path: getPattern('wallet-firmware-update') }))
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Notification
|
|
|
|
|
key="update-firmware"
|
|
|
|
@ -27,4 +36,4 @@ export default (props: Props) => {
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|