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.
44 lines
897 B
44 lines
897 B
6 years ago
|
/* @flow */
|
||
|
|
||
|
import * as IMPORT from 'actions/constants/importAccount';
|
||
|
|
||
|
import type { Action } from 'flowtype';
|
||
|
|
||
|
export type ImportState = {
|
||
|
loading: boolean,
|
||
|
error: ?string,
|
||
|
};
|
||
|
|
||
|
export const initialState: ImportState = {
|
||
|
loading: false,
|
||
|
error: null,
|
||
|
};
|
||
|
|
||
|
export default (state: ImportState = initialState, action: Action): ImportState => {
|
||
|
switch (action.type) {
|
||
|
case IMPORT.START:
|
||
|
return {
|
||
|
...state,
|
||
|
loading: true,
|
||
|
error: null,
|
||
|
};
|
||
|
|
||
|
case IMPORT.SUCCESS:
|
||
|
return {
|
||
|
...state,
|
||
|
loading: false,
|
||
|
error: null,
|
||
|
};
|
||
|
|
||
|
case IMPORT.FAIL:
|
||
|
return {
|
||
|
...state,
|
||
|
loading: false,
|
||
|
error: action.error,
|
||
|
};
|
||
|
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
};
|