diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-03-24 10:01:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-24 10:01:05 +0100 |
commit | c066c9818690903ca656e33060d4d77f36cbdc5b (patch) | |
tree | 2a29d528d46f14b62aed5ec2833b81f1e3474661 /server/sonar-web/src/main/js/apps/settings | |
parent | 70d52b56bb19ef9725b3cb598563e6684bc3327a (diff) | |
download | sonarqube-c066c9818690903ca656e33060d4d77f36cbdc5b.tar.gz sonarqube-c066c9818690903ca656e33060d4d77f36cbdc5b.zip |
add flow-typed definitions (#1847)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/settings')
-rw-r--r-- | server/sonar-web/src/main/js/apps/settings/components/App.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/settings/components/App.js b/server/sonar-web/src/main/js/apps/settings/components/App.js index 9701d248b2a..e8963b39fc5 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/App.js +++ b/server/sonar-web/src/main/js/apps/settings/components/App.js @@ -45,7 +45,10 @@ class App extends React.Component { state: State = { loaded: false }; componentDidMount() { - document.querySelector('html').classList.add('dashboard-page'); + const html = document.querySelector('html'); + if (html) { + html.classList.add('dashboard-page'); + } const componentKey = this.props.component ? this.props.component.key : null; this.props.fetchSettings(componentKey).then(() => { this.setState({ loaded: true }); @@ -64,7 +67,10 @@ class App extends React.Component { } componentWillUnmount() { - document.querySelector('html').classList.remove('dashboard-page'); + const html = document.querySelector('html'); + if (html) { + html.classList.remove('dashboard-page'); + } } render() { |