mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-02 12:20:53 +00:00
change prefix of coin specific reducers
This commit is contained in:
parent
e34b9141d8
commit
eafd541477
@ -75,16 +75,15 @@ export const initialState: State = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default (state: State = initialState, action: Action): State => {
|
export default (state: State = initialState, action: Action): State => {
|
||||||
|
if (action.type === ACCOUNT.DISPOSE) return initialState;
|
||||||
|
if (!action.networkType || action.networkType !== 'ethereum') return state;
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case SEND.INIT:
|
case SEND.INIT:
|
||||||
case SEND.CHANGE:
|
case SEND.CHANGE:
|
||||||
case SEND.VALIDATION:
|
case SEND.VALIDATION:
|
||||||
return action.state;
|
return action.state;
|
||||||
|
|
||||||
case ACCOUNT.DISPOSE:
|
|
||||||
return initialState;
|
|
||||||
|
|
||||||
|
|
||||||
case SEND.TOGGLE_ADVANCED:
|
case SEND.TOGGLE_ADVANCED:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
@ -38,13 +38,11 @@ export type State = {
|
|||||||
export const initialState: State = {
|
export const initialState: State = {
|
||||||
networkName: '',
|
networkName: '',
|
||||||
networkSymbol: '',
|
networkSymbol: '',
|
||||||
currency: '',
|
|
||||||
|
|
||||||
advanced: false,
|
advanced: false,
|
||||||
untouched: true,
|
untouched: true,
|
||||||
touched: {},
|
touched: {},
|
||||||
address: '',
|
address: '',
|
||||||
//address: '0x574BbB36871bA6b78E27f4B4dCFb76eA0091880B',
|
|
||||||
amount: '',
|
amount: '',
|
||||||
setMax: false,
|
setMax: false,
|
||||||
feeLevels: [],
|
feeLevels: [],
|
||||||
@ -55,23 +53,23 @@ export const initialState: State = {
|
|||||||
},
|
},
|
||||||
sequence: '0',
|
sequence: '0',
|
||||||
total: '0',
|
total: '0',
|
||||||
sending: false,
|
|
||||||
errors: {},
|
errors: {},
|
||||||
warnings: {},
|
warnings: {},
|
||||||
infos: {},
|
infos: {},
|
||||||
|
|
||||||
|
sending: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default (state: State = initialState, action: Action): State => {
|
export default (state: State = initialState, action: Action): State => {
|
||||||
|
if (action.type === ACCOUNT.DISPOSE) return initialState;
|
||||||
|
if (!action.networkType || action.networkType !== 'ripple') return state;
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case SEND.INIT:
|
case SEND.INIT:
|
||||||
case SEND.CHANGE:
|
case SEND.CHANGE:
|
||||||
case SEND.VALIDATION:
|
case SEND.VALIDATION:
|
||||||
// return action.state;
|
return action.state;
|
||||||
return state;
|
|
||||||
|
|
||||||
case ACCOUNT.DISPOSE:
|
|
||||||
return initialState;
|
|
||||||
|
|
||||||
|
|
||||||
case SEND.TOGGLE_ADVANCED:
|
case SEND.TOGGLE_ADVANCED:
|
||||||
return {
|
return {
|
@ -10,8 +10,8 @@ import modal from 'reducers/ModalReducer';
|
|||||||
import web3 from 'reducers/Web3Reducer';
|
import web3 from 'reducers/Web3Reducer';
|
||||||
import accounts from 'reducers/AccountsReducer';
|
import accounts from 'reducers/AccountsReducer';
|
||||||
import selectedAccount from 'reducers/SelectedAccountReducer';
|
import selectedAccount from 'reducers/SelectedAccountReducer';
|
||||||
import sendForm from 'reducers/SendFormReducer';
|
import sendFormEthereum from 'reducers/SendFormEthereumReducer';
|
||||||
import rippleSendForm from 'reducers/RippleSendFormReducer';
|
import sendFormRipple from 'reducers/SendFormRippleReducer';
|
||||||
import receive from 'reducers/ReceiveReducer';
|
import receive from 'reducers/ReceiveReducer';
|
||||||
import summary from 'reducers/SummaryReducer';
|
import summary from 'reducers/SummaryReducer';
|
||||||
import tokens from 'reducers/TokensReducer';
|
import tokens from 'reducers/TokensReducer';
|
||||||
@ -33,8 +33,8 @@ const reducers = {
|
|||||||
web3,
|
web3,
|
||||||
accounts,
|
accounts,
|
||||||
selectedAccount,
|
selectedAccount,
|
||||||
sendForm,
|
sendFormEthereum,
|
||||||
rippleSendForm,
|
sendFormRipple,
|
||||||
receive,
|
receive,
|
||||||
summary,
|
summary,
|
||||||
tokens,
|
tokens,
|
||||||
|
Loading…
Reference in New Issue
Block a user