diff --git a/client/components/bundle.js b/client/components/bundle.js index 698b5f15..6774b9fa 100644 --- a/client/components/bundle.js +++ b/client/components/bundle.js @@ -6,7 +6,7 @@ import load from "little-loader"; export class Bundle extends React.Component { state = { mod: null }; - componentWillMount() { + componentDidMount() { this.load(this.props) } diff --git a/client/components/input.js b/client/components/input.js index 56aae6dc..b17b9827 100644 --- a/client/components/input.js +++ b/client/components/input.js @@ -46,7 +46,7 @@ export class Enabler extends React.Component { super(props); } - componentWillMount(){ + componentDidMount(){ requestAnimationFrame(() => { this.toggle(this.props.defaultValue || false); }); diff --git a/client/pages/adminpage.js b/client/pages/adminpage.js index 1e0dafad..76137b94 100644 --- a/client/pages/adminpage.js +++ b/client/pages/adminpage.js @@ -25,10 +25,10 @@ function AdminOnly(WrappedComponent){ notify.send("Error: " + (err && err.message) , "error"); }); }; + this.timeout = window.setInterval(this.admin.bind(this), 30 * 1000); } - componentWillMount(){ - this.timeout = window.setInterval(this.admin.bind(this), 30 * 1000); + componentDidMount(){ this.admin.call(this); } diff --git a/client/pages/adminpage/config.js b/client/pages/adminpage/config.js index 549875cd..cdb8da82 100644 --- a/client/pages/adminpage/config.js +++ b/client/pages/adminpage/config.js @@ -11,7 +11,7 @@ export class ConfigPage extends React.Component { }; } - componentWillMount(){ + componentDidMount(){ Config.all().then((c) => { delete c.constant; // The constant key contains read only global variable that are // application wide truth => not editable from the admin area diff --git a/client/pages/adminpage/dashboard.js b/client/pages/adminpage/dashboard.js index d4615d5e..3ac61e5c 100644 --- a/client/pages/adminpage/dashboard.js +++ b/client/pages/adminpage/dashboard.js @@ -15,7 +15,7 @@ export class DashboardPage extends React.Component { }; } - componentWillMount(){ + componentDidMount(){ Promise.all([ Backend.all(), Config.all() diff --git a/client/pages/adminpage/logger.js b/client/pages/adminpage/logger.js index 0a326dec..1baf8e36 100644 --- a/client/pages/adminpage/logger.js +++ b/client/pages/adminpage/logger.js @@ -16,7 +16,7 @@ export class LogPage extends React.Component { }; } - componentWillMount(){ + componentDidMount(){ Config.all().then((config) => { this.setState({ form: {"":{"params":config["log"]}}, diff --git a/client/pages/adminpage/plugin.js b/client/pages/adminpage/plugin.js index 97266a44..59df4fc1 100644 --- a/client/pages/adminpage/plugin.js +++ b/client/pages/adminpage/plugin.js @@ -20,7 +20,7 @@ export class PluginPage extends React.Component { }; } - componentWillMount(){ + componentDidMount(){ Plugin.all().then((list) => this.setState({plugins: list})); } diff --git a/client/pages/connectpage.js b/client/pages/connectpage.js index b2843ec2..7492627f 100644 --- a/client/pages/connectpage.js +++ b/client/pages/connectpage.js @@ -21,7 +21,7 @@ export class ConnectPage extends React.Component { }; } - componentWillMount(){ + componentDidMount(){ const urlData = urlParams(); const get_params = Object.keys(urlData); if(get_params.length === 0){ diff --git a/client/pages/filespage/submenu.js b/client/pages/filespage/submenu.js index 88e5cccc..79455981 100644 --- a/client/pages/filespage/submenu.js +++ b/client/pages/filespage/submenu.js @@ -22,14 +22,14 @@ export class Submenu extends React.Component { search_keyword: "", search_input_visible: false }); - this.refs.$input.blur(); + if(this.refs.$input) this.refs.$input.blur(); this.props.onSearch(null); }else if(e.ctrlKey && e.keyCode === 70){ // 'Ctrl F' shortcut to search e.preventDefault(); this.setState({ search_input_visible: true }); - this.refs.$input.focus(); + if(this.refs.$input) this.refs.$input.focus(); }else if(e.altKey && (e.keyCode === 49 || e.keyCode === 50)){ // 'alt 1' 'alt 2' shortcut e.preventDefault(); this.onViewChange(); diff --git a/package.json b/package.json index ac4bf4bc..655e10fd 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,26 @@ "dependencies": { "aes-js": "git+https://github.com/mickael-kerjean/aes-js.git", "bcryptjs": "^2.4.3", + "codemirror": "^5.26.0", + "exif-js": "^2.3.0", "little-loader": "^0.2.0", - "react-selectable": "git+https://github.com/mickael-kerjean/react-selectable.git" + "prop-types": "^15.5.10", + "react": "^16.5.0", + "react-addons-css-transition-group": "^15.6.2", + "react-dnd": "^2.4.0", + "react-dnd-html5-backend-filedrop": "^1.0.0", + "react-dom": "^16.5.0", + "react-draggable": "^2.2.6", + "react-infinite-scroller": "^1.1.4", + "react-router": "^4.3.1", + "react-router-dom": "^4.3.1", + "react-selectable": "git+https://github.com/mickael-kerjean/react-selectable.git", + "react-sticky": "^6.0.2", + "rxjs": "^5.4.0", + "video.js": "^5.19.2", + "videojs-contrib-hls": "^5.14.1", + "videojs-sublime-skin": "^1.0.3", + "wavesurfer.js": "^1.4.0" }, "devDependencies": { "babel-core": "^6.13.2", @@ -27,35 +45,17 @@ "babel-preset-react": "^6.11.1", "babel-preset-stage-2": "^6.24.1", "babelify": "^8.0.0", - "codemirror": "^5.26.0", "compression-webpack-plugin": "^1.1.11", "copy-webpack-plugin": "^4.5.2", "css-loader": "^0.28.10", - "exif-js": "^2.3.0", "html-loader": "^0.4.5", "html-webpack-plugin": "^3.2.0", "node-sass": "^4.10.0", - "prop-types": "^15.5.10", - "react": "^15.6.2", - "react-addons-css-transition-group": "^15.6.2", - "react-dnd": "^2.4.0", - "react-dnd-html5-backend-filedrop": "^1.0.0", - "react-dom": "^15.6.2", - "react-draggable": "^2.2.6", - "react-infinite-scroller": "^1.1.4", - "react-router": "^4.1.1", - "react-router-dom": "^4.1.1", - "react-sticky": "^6.0.2", - "rxjs": "^5.4.0", "sass-loader": "^6.0.6", "sass-variable-loader": "^0.1.2", "style-loader": "^0.20.2", "uglifyjs-webpack-plugin": "^1.2.5", "url-loader": "^0.6.2", - "video.js": "^5.19.2", - "videojs-contrib-hls": "^5.14.1", - "videojs-sublime-skin": "^1.0.3", - "wavesurfer.js": "^1.4.0", "webpack": "^2.7.0", "webpack-bundle-analyzer": "^3.3.2", "worker-loader": "^2.0.0"