mirror of
https://github.com/trezor/trezor-wallet
synced 2025-07-13 18:18:09 +00:00
add gotoBackup action
This commit is contained in:
parent
81f1cbfda8
commit
210beb1a40
@ -347,6 +347,17 @@ export const gotoFirmwareUpdate = (): ThunkAction => (dispatch: Dispatch, getSta
|
|||||||
dispatch(goto(`/device/${devUrl}/firmware-update`));
|
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
|
* Try to redirect to initial url
|
||||||
*/
|
*/
|
||||||
|
@ -10,14 +10,14 @@ export default (props: Props) => {
|
|||||||
if (!needsBackup) return null;
|
if (!needsBackup) return null;
|
||||||
return (
|
return (
|
||||||
<Notification
|
<Notification
|
||||||
key="needs-backup"
|
key="no-backup"
|
||||||
type="warning"
|
type="warning"
|
||||||
title="Your Trezor is not backed up!"
|
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."
|
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={
|
actions={
|
||||||
[{
|
[{
|
||||||
label: 'Create a backup',
|
label: 'Create a backup',
|
||||||
callback: () => {}, //TODO
|
callback: props.routerActions.gotoBackup,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user