mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-27 02:38:18 +00:00
added beta build
This commit is contained in:
parent
8b332b4763
commit
a36a5e9dbe
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
build
|
||||
build-devel
|
||||
build-beta
|
||||
build-dev
|
||||
|
||||
# Dependency directory
|
||||
node_modules
|
||||
|
@ -11,7 +11,8 @@
|
||||
"dev": "npx webpack-dev-server --config webpack/dev.babel.js",
|
||||
"dev:local": "npx webpack-dev-server --config webpack/local.babel.js",
|
||||
"build:prod": "rimraf build && npx webpack --config webpack/production.babel.js --progress --bail",
|
||||
"build:dev": "rimraf build-devel && cross-env BUILD=development npx webpack --config webpack/production.babel.js --output-path build-devel --progress --bail",
|
||||
"build:beta": "rimraf build-beta && cross-env BUILD=beta npx webpack --config webpack/production.babel.js --output-path build-beta --progress --bail",
|
||||
"build:dev": "rimraf build-dev && cross-env BUILD=development npx webpack --config webpack/production.babel.js --output-path build-dev --progress --bail",
|
||||
"build": "run-s build:*",
|
||||
"flow": "flow check src",
|
||||
"lint": "run-s lint:*",
|
||||
|
@ -8,6 +8,7 @@ import * as DISCOVERY from 'actions/constants/discovery';
|
||||
import * as STORAGE from 'actions/constants/localStorage';
|
||||
import * as PENDING from 'actions/constants/pendingTx';
|
||||
import { httpRequest } from 'utils/networkUtils';
|
||||
import * as buildUtils from 'utils/build';
|
||||
|
||||
import type {
|
||||
ThunkAction, AsyncAction, /* GetState, */ Dispatch,
|
||||
@ -96,6 +97,12 @@ export function loadTokensFromJSON(): AsyncAction {
|
||||
|
||||
try {
|
||||
const config: Config = await httpRequest(AppConfigJSON, 'json');
|
||||
|
||||
if (!buildUtils.isDev()) {
|
||||
const index = config.coins.findIndex(c => c.network === 'trop');
|
||||
delete config.coins[index];
|
||||
}
|
||||
|
||||
const ERC20Abi = await httpRequest(Erc20AbiJSON, 'json');
|
||||
|
||||
window.addEventListener('storage', (event) => {
|
||||
|
@ -8,6 +8,7 @@ import * as NOTIFICATION from 'actions/constants/notification';
|
||||
import { getDuplicateInstanceNumber } from 'reducers/utils';
|
||||
import * as RouterActions from 'actions/RouterActions';
|
||||
import * as deviceUtils from 'utils/device';
|
||||
import * as buildUtils from 'utils/build';
|
||||
|
||||
import type {
|
||||
DeviceMessage,
|
||||
@ -123,9 +124,9 @@ export const init = (): AsyncAction => async (dispatch: Dispatch, getState: GetS
|
||||
});
|
||||
});
|
||||
|
||||
window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle
|
||||
// window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://connect.trezor.io/5/'; // eslint-disable-line no-underscore-dangle
|
||||
if (process.env.BUILD === 'development' || process.env.NODE_ENV === 'development') {
|
||||
if (buildUtils.isDev()) {
|
||||
window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://sisyfos.trezor.io/connect/'; // eslint-disable-line no-underscore-dangle
|
||||
// window.__TREZOR_CONNECT_SRC = typeof LOCAL === 'string' ? LOCAL : 'https://connect.trezor.io/5/'; // eslint-disable-line no-underscore-dangle
|
||||
window.TrezorConnect = TrezorConnect;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import services from 'services';
|
||||
|
||||
import Raven from 'raven-js';
|
||||
import RavenMiddleware from 'redux-raven-middleware';
|
||||
import * as buildUtils from 'utils/build';
|
||||
|
||||
import type { Action, GetState } from 'flowtype';
|
||||
|
||||
@ -23,8 +24,8 @@ const middlewares = [
|
||||
routerMiddleware(history),
|
||||
];
|
||||
|
||||
// sentry io middleware only in dev build
|
||||
if (process.env.BUILD === 'development') {
|
||||
// sentry io middleware only in dev and beta build
|
||||
if (buildUtils.isDev() || buildUtils.isBeta()) {
|
||||
const RAVEN_KEY = 'https://34b8c09deb6c4cd2a4dc3f0029cd02d8@sentry.io/1279550';
|
||||
const ravenMiddleware = RavenMiddleware(RAVEN_KEY);
|
||||
Raven.config(RAVEN_KEY).install();
|
||||
@ -32,7 +33,7 @@ if (process.env.BUILD === 'development') {
|
||||
}
|
||||
|
||||
let composedEnhancers: any;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (buildUtils.isDev()) {
|
||||
const excludeLogger = (getState: GetState, action: Action): boolean => {
|
||||
//'@@router/LOCATION_CHANGE'
|
||||
const excluded: Array<?string> = ['LOG_TO_EXCLUDE', 'log__add', undefined];
|
||||
|
7
src/utils/build.js
Normal file
7
src/utils/build.js
Normal file
@ -0,0 +1,7 @@
|
||||
/* @flow */
|
||||
|
||||
// process.env.BUILD is set by package.json
|
||||
// process.env.NODE_ENV is set by webpack.mode
|
||||
|
||||
export const isDev = (): boolean => process.env.BUILD === 'development' || process.env.NODE_ENV === 'development';
|
||||
export const isBeta = (): boolean => process.env.BUILD === 'beta';
|
Loading…
Reference in New Issue
Block a user