mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
821 B
22 lines
821 B
/* @flow */
|
|
import urlConstants from 'constants/urls';
|
|
import type { TrezorDevice } from 'flowtype';
|
|
|
|
const getOldWalletUrl = (device: ?TrezorDevice): string => {
|
|
if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA;
|
|
const release = device.firmwareRelease;
|
|
const url = release.channel === 'beta' ? urlConstants.OLD_WALLET_BETA : urlConstants.OLD_WALLET;
|
|
return url;
|
|
};
|
|
|
|
// TODO: use uri template to build urls
|
|
const getOldWalletReleaseUrl = (device: ?TrezorDevice): string => {
|
|
if (!device || !device.firmwareRelease) return urlConstants.OLD_WALLET_BETA;
|
|
const release = device.firmwareRelease;
|
|
const url = getOldWalletUrl(device);
|
|
const version = release.version.join('.');
|
|
return `${url}?fw=${version}`;
|
|
};
|
|
|
|
export { getOldWalletUrl, getOldWalletReleaseUrl };
|