Moving manifest/serviceworker into build script

This commit is contained in:
James Barnsley
2018-07-22 21:22:35 +12:00
parent 618d03e42d
commit fa4d039375
18 changed files with 796 additions and 751 deletions

View File

@ -31,18 +31,21 @@ class App extends React.Component{
this.handleKeyUp = this.handleKeyUp.bind(this);
this.handleKeyDown = this.handleKeyDown.bind(this);
this.handleWindowResize = this.handleWindowResize.bind(this);
this.handleInstallPrompt = this.handleInstallPrompt.bind(this);
}
componentWillMount(){
window.addEventListener("keyup", this.handleKeyUp, false);
window.addEventListener("keydown", this.handleKeyDown, false);
window.addEventListener("resize", this.handleWindowResize, false);
window.addEventListener("beforeinstallprompt", this.handleInstallPrompt, false);
}
componentWillUnmount(){
window.removeEventListener("keyup", this.handleKeyUp, false);
window.removeEventListener("keydown", this.handleKeyDown, false);
window.removeEventListener("resize", this.handleWindowResize, false);
window.removeEventListener("beforeinstallprompt", this.handleInstallPrompt, false);
}
componentDidMount(){
@ -50,10 +53,11 @@ class App extends React.Component{
if (this.props.allow_reporting){
ReactGA.initialize('UA-64701652-3');
/*
if (Raven !== undefined){
console.log('mounted')
Raven.config('https://ca99fb6662fe40ae8ec4c18a466e4b4b@sentry.io/219026').install();
}
*/
}
// Fire up our services
@ -149,6 +153,11 @@ class App extends React.Component{
}
}
handleInstallPrompt(e){
e.preventDefault();
this.props.uiActions.installPrompt(e);
}
handleWindowResize(e){
var width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
var height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0)