Add delayed presentationMode thunks.
parent
87937e8bc3
commit
a18e6e4f98
|
@ -9,7 +9,7 @@ import DashboardHeader from 'src/dashboards/components/DashboardHeader';
|
||||||
import timeRanges from 'hson!../../shared/data/timeRanges.hson';
|
import timeRanges from 'hson!../../shared/data/timeRanges.hson';
|
||||||
import {getMappings, getAppsForHosts, getMeasurementsForHost, getAllHosts} from 'src/hosts/apis';
|
import {getMappings, getAppsForHosts, getMeasurementsForHost, getAllHosts} from 'src/hosts/apis';
|
||||||
import {fetchLayouts} from 'shared/apis';
|
import {fetchLayouts} from 'shared/apis';
|
||||||
import {enablePresentationMode} from 'shared/actions/ui';
|
import {delayEnablePresentationMode} from 'shared/actions/ui';
|
||||||
|
|
||||||
const {
|
const {
|
||||||
shape,
|
shape,
|
||||||
|
@ -187,7 +187,7 @@ const mapStateToProps = (state) => ({
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
handleClickPresentationButton: () => {
|
handleClickPresentationButton: () => {
|
||||||
dispatch(enablePresentationMode())
|
dispatch(delayEnablePresentationMode())
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import {PRESENTATION_MODE_DELAY} from '../constants'
|
||||||
|
|
||||||
export function enablePresentationMode() {
|
export function enablePresentationMode() {
|
||||||
return {
|
return {
|
||||||
type: 'ENABLE_PRESENTATION_MODE',
|
type: 'ENABLE_PRESENTATION_MODE',
|
||||||
|
@ -9,3 +11,15 @@ export function disablePresentationMode() {
|
||||||
type: 'DISABLE_PRESENTATION_MODE',
|
type: 'DISABLE_PRESENTATION_MODE',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function delayEnablePresentationMode() {
|
||||||
|
return (dispatch) => {
|
||||||
|
setTimeout(() => dispatch(enablePresentationMode()), PRESENTATION_MODE_DELAY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delayDisablePresentationMode() {
|
||||||
|
return (dispatch) => {
|
||||||
|
setTimeout(() => dispatch(disablePresentationMode()), PRESENTATION_MODE_DELAY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -467,3 +467,5 @@ export const STROKE_WIDTH = {
|
||||||
heavy: 3.5,
|
heavy: 3.5,
|
||||||
light: 1.5,
|
light: 1.5,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const PRESENTATION_MODE_DELAY = 250 // In milliseconds.
|
||||||
|
|
Loading…
Reference in New Issue