1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

duplicate device without modal with default instance name

This commit is contained in:
Szymon Lesisz 2018-08-16 22:59:41 +02:00
parent dbbe7725fd
commit ebbba8139a

View File

@ -8,6 +8,7 @@ import * as TOKEN from './constants/token';
import * as CONNECT from './constants/TrezorConnect';
import * as NOTIFICATION from './constants/notification';
import * as WALLET from './constants/wallet';
import { getNewInstance } from '../reducers/DevicesReducer';
import { push } from 'react-router-redux';
import * as DiscoveryActions from './DiscoveryActions';
@ -401,10 +402,17 @@ export const forget = (device: TrezorDevice): Action => ({
});
export const duplicateDevice = (device: TrezorDevice): AsyncAction => async (dispatch: Dispatch, getState: GetState): Promise<void> => {
// dispatch({
// type: CONNECT.TRY_TO_DUPLICATE,
// device,
// });
const instance: number = getNewInstance(getState().devices, device);
const extended: Object = { instance };
dispatch({
type: CONNECT.TRY_TO_DUPLICATE,
device,
});
type: CONNECT.DUPLICATE,
device: { ...device, ...extended }
})
};