1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-01-08 07:01:04 +00:00

add gotoBackup action

This commit is contained in:
slowbackspace 2019-02-25 13:28:41 +01:00
parent 19dbf88d3c
commit b0d67bd667
2 changed files with 13 additions and 2 deletions

View File

@ -347,6 +347,17 @@ export const gotoFirmwareUpdate = (): ThunkAction => (dispatch: Dispatch, getSta
dispatch(goto(`/device/${devUrl}/firmware-update`));
};
/*
* Go to NoBackup page
*/
export const gotoBackup = (): ThunkAction => (dispatch: Dispatch, getState: GetState): void => {
const { selectedDevice } = getState().wallet;
if (!selectedDevice || !selectedDevice.features) return;
const devUrl: string = `${selectedDevice.features.device_id}${selectedDevice.instance ? `:${selectedDevice.instance}` : ''}`;
dispatch(goto(`/device/${devUrl}/backup`));
};
/*
* Try to redirect to initial url
*/

View File

@ -10,14 +10,14 @@ export default (props: Props) => {
if (!needsBackup) return null;
return (
<Notification
key="needs-backup"
key="no-backup"
type="warning"
title="Your Trezor is not backed up!"
message="If your device is ever lost or damaged, your funds will be lost. Backup your device first, to protect your coins against such events."
actions={
[{
label: 'Create a backup',
callback: () => {}, //TODO
callback: props.routerActions.gotoBackup,
}]
}
/>