1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-05 15:49:00 +00:00

fixed clone device redirect url

This commit is contained in:
Szymon Lesisz 2018-05-02 13:39:27 +02:00
parent eb0a40c417
commit 0bc4dd3cf9
7 changed files with 26 additions and 19 deletions

View File

@ -6,9 +6,10 @@ yarn run build
printf "\n-- COPYING FILES ----------------------\n"
cd build
rsync -avz --delete -e ssh . admin@dev.sldev.cz:~/experiments/www
rsync -avz --delete -e ssh ./build/* admin@dev.sldev.cz:~/mytrezor/ethereum/www
# cd build
# rsync -avz --delete -e ssh . admin@dev.sldev.cz:~/experiments/www
# rsync -avz --delete -e ssh ./build/* admin@dev.sldev.cz:~/mytrezor/ethereum/www
rsync -avz --delete -e ssh ./build/* admin@dev.sldev.cz:~/experiments/www
cd ../
printf "\n-- COMPLETE ---------------------------\n"

View File

@ -70,8 +70,6 @@ export const start = (device: TrezorDevice, network: string, ignoreCompleted?: b
return;
}
const discovery: State = getState().discovery;
let discoveryProcess: ?Discovery = discovery.find(d => d.deviceState === device.state && d.network === network);

View File

@ -44,7 +44,7 @@ export type TrezorConnectAction = {
type: typeof CONNECT.SELECT_DEVICE,
payload: ?{
id: string,
instance: string
instance: ?number
}
} | {
type: typeof CONNECT.COIN_CHANGED,
@ -127,9 +127,9 @@ export const init = (): AsyncAction => {
try {
await TrezorConnect.init({
transportReconnect: true,
connectSrc: 'https://localhost:8088/',
// connectSrc: 'https://localhost:8088/',
// connectSrc: 'https://connect.trezor.io/tpm/',
// connectSrc: 'https://sisyfos.trezor.io/',
connectSrc: 'https://sisyfos.trezor.io/',
debug: false,
popup: false,
webusb: true
@ -256,7 +256,7 @@ export const onSelectDevice = (device: TrezorDevice | Device): ThunkAction => {
}
// check if current location is not set to this device
//dispatch( push(`/device/${ device.features.device_id }/network/etc/address/0`) );
if (urlParams.deviceInstance !== instance || urlParams.device !== deviceId) {
dispatch( push(url) );
}
@ -485,7 +485,7 @@ export const forget = (device: TrezorDevice): Action => {
};
}
export const duplicateDevice = (device: any): AsyncAction => {
export const duplicateDevice = (device: TrezorDevice): AsyncAction => {
return async (dispatch: Dispatch, getState: GetState): Promise<void> => {
dispatch({
type: CONNECT.TRY_TO_DUPLICATE,

View File

@ -61,7 +61,7 @@ export default class RememberDevice extends Component<Props, State> {
}
}
render(): any {
render() {
if (!this.props.modal.opened) return null;
const { device, instances } = this.props.modal;
const { onForgetDevice, onRememberDevice } = this.props.modalActions;
@ -69,8 +69,8 @@ export default class RememberDevice extends Component<Props, State> {
let label = device.label;
let devicePlural = false;
if (instances && instances.length > 0) {
label = instances.map(i => {
return (<span>{i.instanceLabel}</span>);
label = instances.map((instance, index) => {
return (<span key={index}>{instance.instanceLabel}</span>);
})
devicePlural = instances.length > 1;
}
@ -85,7 +85,8 @@ export default class RememberDevice extends Component<Props, State> {
}
}
export const ForgetDevice = (props: any): any => {
export const ForgetDevice = (props: Props) => {
if (!props.modal.opened) return null;
const { device } = props.modal;
const { onForgetSingleDevice, onCancel } = props.modalActions;
return (
@ -98,7 +99,8 @@ export const ForgetDevice = (props: any): any => {
);
}
export const DisconnectDevice = (props: any): any => {
export const DisconnectDevice = (props: Props) => {
if (!props.modal.opened) return null;
const { device } = props.modal;
const { onForgetSingleDevice, onCancel } = props.modalActions;
return (

View File

@ -159,8 +159,7 @@ export class DeviceDropdown extends Component<Props> {
let elem: any = (event.target : any);
let block: boolean = false;
while (elem.parentElement) {
// if (elem.className.indexOf('aside-button') >= 0) {
if (elem.tagName.toLowerCase() === 'aside' || (elem.className && elem.className.indexOf('modal-container') >= 0)) {
if (elem.tagName.toLowerCase() === 'aside' || (elem.className && elem.className.indexOf && elem.className.indexOf('modal-container') >= 0)) {
block = true;
break;
}

View File

@ -1,6 +1,7 @@
/* @flow */
'use strict';
import * as MODAL from '../actions/constants/modal';
import * as WEB3 from '../actions/constants/web3';
import * as WALLET from '../actions/constants/wallet';
@ -42,6 +43,12 @@ export default function wallet(state: State = initialState, action: Action): Sta
dropdownOpened: action.opened
}
case MODAL.CLOSE :
return {
...state,
dropdownOpened: false
}
default:
return state;
}

View File

@ -53,7 +53,7 @@ const validation = (api: MiddlewareAPI, params: RouterLocationState): boolean =>
let device: ?TrezorDevice;
if (params.hasOwnProperty('deviceInstance')) {
device = devices.find(d => d.features && d.features.device_id === params.device && d.instance === params.deviceInstance );
device = devices.find(d => d.features && d.features.device_id === params.device && d.instance === parseInt(params.deviceInstance ) );
} else {
device = devices.find(d => d.path === params.device || (d.features && d.features.device_id === params.device));
}
@ -136,7 +136,7 @@ const RouterService: Middleware = (api: MiddlewareAPI) => (next: MiddlewareDispa
type: CONNECT.SELECT_DEVICE,
payload: {
id: requestedParams.device,
instance: requestedParams.deviceInstance
instance: requestedParams.deviceInstance ? parseInt(requestedParams.deviceInstance) : undefined
}
});
}