@adactive/adsum-screensaver-asia
Advanced tools
Comparing version 2.5.5 to 2.5.6
{ | ||
"name": "@adactive/adsum-screensaver-asia", | ||
"version": "2.5.5", | ||
"version": "2.5.6", | ||
"description": "Adsum Screensaver Component", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,3 +59,4 @@ // @flow | ||
customCloseFunction, | ||
loadingScreenState | ||
loadingScreenState, | ||
forceOpenScreenSaver | ||
} = this.props; | ||
@@ -82,2 +83,9 @@ | ||
} | ||
if(screenSaverState.forceOpen) { | ||
if (this.timer) { clearTimeout(this.timer); } | ||
this.setState({ | ||
screensaverIsOpen: true, | ||
}) | ||
forceOpenScreenSaver(false); | ||
} | ||
} | ||
@@ -161,5 +169,8 @@ | ||
dispatch(ScreenSaverActions.screenSaverClose(value)); | ||
} | ||
}, | ||
forceOpenScreenSaver: (value: ?boolean) => { | ||
dispatch(ScreenSaverActions.forceOpenScreenSaver(value)); | ||
}, | ||
}); | ||
export default connect(mapStateToProps, mapDispatchToProps)(ScreenSaver); |
@@ -5,2 +5,3 @@ // @flow | ||
export const SCREEN_SAVER_CLOSE = 'SCREEN_SAVER_CLOSE'; | ||
export const FORCE_OPEN_SCREEN_SAVER = 'FORCE_OPEN_SCREEN_SAVER'; | ||
@@ -24,1 +25,10 @@ export function appClick(click) { | ||
} | ||
export function forceOpenScreenSaver(value) { | ||
return (dispatch) => { | ||
dispatch({ | ||
type: FORCE_OPEN_SCREEN_SAVER, | ||
payload: value | ||
}); | ||
}; | ||
} |
// @flow | ||
import { APP_CLICK, SCREEN_SAVER_CLOSE } from './ScreenSaverActions'; | ||
import { APP_CLICK, SCREEN_SAVER_CLOSE, FORCE_OPEN_SCREEN_SAVER } from './ScreenSaverActions'; | ||
const initialState = { | ||
appClicked: false, | ||
screenSaverClose: false | ||
screenSaverClose: false, | ||
forceOpen:false | ||
}; | ||
@@ -20,2 +21,6 @@ | ||
}); | ||
case FORCE_OPEN_SCREEN_SAVER: | ||
return Object.assign({}, state, { | ||
forceOpen: action.payload | ||
}); | ||
default: | ||
@@ -22,0 +27,0 @@ return state; |
11932
236