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.
26 lines
521 B
26 lines
521 B
/* @flow */
|
|
'use strict';
|
|
|
|
import * as LOG from './constants/log';
|
|
|
|
import type { AsyncAction, GetState, Dispatch } from '../flowtype';
|
|
|
|
export type LogAction = {
|
|
type: typeof LOG.OPEN,
|
|
} | {
|
|
type: typeof LOG.CLOSE,
|
|
};
|
|
|
|
export const toggle = (): AsyncAction => {
|
|
return (dispatch: Dispatch, getState: GetState): void => {
|
|
|
|
if (!getState().log.opened) {
|
|
window.scrollTo(0, 0);
|
|
}
|
|
|
|
dispatch({
|
|
type: getState().log.opened ? LOG.CLOSE : LOG.OPEN
|
|
});
|
|
}
|
|
}
|