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.
46 lines
736 B
46 lines
736 B
6 years ago
|
/* @flow */
|
||
|
'use strict';
|
||
|
|
||
|
type LogEntry = {
|
||
|
time: number;
|
||
|
type: string;
|
||
|
messgage: string;
|
||
|
}
|
||
|
|
||
|
export type State = {
|
||
|
opened: boolean;
|
||
|
entries: Array<LogEntry>;
|
||
|
}
|
||
|
|
||
|
export const initialState: State = {
|
||
|
opened: false,
|
||
|
entries: [],
|
||
|
};
|
||
|
|
||
|
|
||
|
export default (state: State = initialState, action: any): State => {
|
||
|
|
||
|
switch (action.type) {
|
||
|
|
||
|
case 'log__open':
|
||
|
return {
|
||
|
...state,
|
||
|
opened: true
|
||
|
}
|
||
|
|
||
|
case 'log__close':
|
||
|
return {
|
||
|
...state,
|
||
|
opened: false
|
||
|
}
|
||
|
|
||
|
case 'log__add':
|
||
|
return {
|
||
|
...state,
|
||
|
}
|
||
|
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
|
||
|
}
|