mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-25 22:42:09 +00:00
duplicate device without modal with default instance name
This commit is contained in:
parent
dbbe7725fd
commit
ebbba8139a
@ -8,6 +8,7 @@ import * as TOKEN from './constants/token';
|
|||||||
import * as CONNECT from './constants/TrezorConnect';
|
import * as CONNECT from './constants/TrezorConnect';
|
||||||
import * as NOTIFICATION from './constants/notification';
|
import * as NOTIFICATION from './constants/notification';
|
||||||
import * as WALLET from './constants/wallet';
|
import * as WALLET from './constants/wallet';
|
||||||
|
import { getNewInstance } from '../reducers/DevicesReducer';
|
||||||
|
|
||||||
import { push } from 'react-router-redux';
|
import { push } from 'react-router-redux';
|
||||||
import * as DiscoveryActions from './DiscoveryActions';
|
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> => {
|
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({
|
dispatch({
|
||||||
type: CONNECT.TRY_TO_DUPLICATE,
|
type: CONNECT.DUPLICATE,
|
||||||
device,
|
device: { ...device, ...extended }
|
||||||
});
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user