changelog: dialog for changelog

This commit is contained in:
muerwre 2018-12-07 17:38:49 +07:00
parent b719b3f1a2
commit 65e549a5af
12 changed files with 218 additions and 34 deletions

View file

@ -40,9 +40,10 @@ export const cropAShot = payload => ({ type: ACTIONS.CROP_A_SHOT, ...payload });
export const setProvider = provider => ({ type: ACTIONS.SET_PROVIDER, provider });
export const setDialog = ({ dialog, dialog_active }) => ({ type: ACTIONS.SET_DIALOG, dialog });
export const setDialog = dialog => ({ type: ACTIONS.SET_DIALOG, dialog });
export const setDialogActive = dialog_active => ({ type: ACTIONS.SET_DIALOG_ACTIVE, dialog_active });
export const locationChanged = location => ({ type: ACTIONS.LOCATION_CHANGED, location });
export const setReady = ready => ({ type: ACTIONS.SET_READY, ready });
export const gotVkUser = user => ({ type: ACTIONS.GOT_VK_USER, user });

View file

@ -42,6 +42,7 @@ export const ACTIONS = ({
SET_PROVIDER: 'SET_PROVIDER',
SET_DIALOG: 'SET_DIALOG',
SET_DIALOG_ACTIVE: 'SET_DIALOG_ACTIVE',
LOCATION_CHANGED: 'LOCATION_CHANGED',
SET_READY: 'SET_READY',

View file

@ -78,10 +78,16 @@ const setRenderer = (state, { payload }) => ({
const setProvider = (state, { provider }) => ({ ...state, provider });
const setDialog = (state, { dialog, dialog_active }) => ({
const setDialog = (state, { dialog }) => ({
...state,
dialog: dialog || state.dialog,
dialog_active: typeof dialog_active !== 'undefined' ? dialog_active : !state.dialog_active,
dialog,
// dialog_active: typeof dialog_active !== 'undefined' ? dialog_active : !state.dialog_active,
// dialog_active,
});
const setDialogActive = (state, { dialog_active }) => ({
...state,
dialog_active: dialog_active || !state.dialog_active,
});
const setReady = (state, { ready = true }) => ({
@ -114,6 +120,7 @@ const HANDLERS = ({
[ACTIONS.SET_PROVIDER]: setProvider,
[ACTIONS.SET_DIALOG]: setDialog,
[ACTIONS.SET_DIALOG_ACTIVE]: setDialogActive,
[ACTIONS.SET_READY]: setReady,
}: { [key: String]: Function });