2016-10-11 18:24:55 +02:00
|
|
|
import history from '../routing/history';
|
|
|
|
|
2016-08-11 18:21:32 -03:00
|
|
|
export const SWITCH_VISUAL_MODE = 'SWITCH_VISUAL_MODE';
|
2017-01-11 20:58:15 -02:00
|
|
|
export const CLOSED_ENTRY = 'CLOSED_ENTRY';
|
2016-08-11 18:21:32 -03:00
|
|
|
|
|
|
|
export function switchVisualMode(useVisualMode) {
|
|
|
|
return {
|
|
|
|
type: SWITCH_VISUAL_MODE,
|
2016-10-11 18:24:55 +02:00
|
|
|
payload: useVisualMode,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-01-11 20:58:15 -02:00
|
|
|
export function closeEntry(collection) {
|
|
|
|
return (dispatch) => {
|
|
|
|
if (collection && collection.get('name', false)) {
|
|
|
|
history.push(`collections/${ collection.get('name') }`);
|
|
|
|
} else {
|
|
|
|
history.goBack();
|
|
|
|
}
|
|
|
|
dispatch({ type: CLOSED_ENTRY });
|
2016-08-11 18:21:32 -03:00
|
|
|
};
|
|
|
|
}
|