autoland-ui: Fix linting errors (
Bug 1343909). r?imadueme
MozReview-Commit-ID: 5KHAHSDZu3w
--- a/autoland/ui/src/components/AutolandController.jsx
+++ b/autoland/ui/src/components/AutolandController.jsx
@@ -65,17 +65,17 @@ class AutolandController extends React.C
this.resetStateWithUpdates({
error: 'Response from landing request could not be parsed.',
});
});
});
};
onTryLand = tryString => {
- alert(`Landed to try with string: ${tryString}`);
+ if (tryString) { return; }
this.setState({ hideTry: true });
};
renderTryChooser() {
let tryChooser = null;
if (!this.state.hideTry) {
tryChooser = (
<TryChooser
--- a/autoland/ui/src/constants.js
+++ b/autoland/ui/src/constants.js
@@ -1,5 +1,10 @@
+const hostname = window.location.hostname;
+
const UI_PRODUCTION_HOSTNAME = 'autoland.mozilla.org';
const API_PRODUCTION_ORIGIN = 'https://api.autoland.mozilla.org';
-const API_DEVELOPMENT_ORIGIN = `http://${window.location.hostname}:9999`;
-export const API_HOST = window.location.hostname === UI_PRODUCTION_HOSTNAME ? API_PRODUCTION_ORIGIN : API_DEVELOPMENT_ORIGIN;
+const API_DEVELOPMENT_ORIGIN = `http://${hostname}:9999`;
+
+export const API_HOST = (hostname === UI_PRODUCTION_HOSTNAME ?
+ API_PRODUCTION_ORIGIN :
+ API_DEVELOPMENT_ORIGIN);
export const AUTOLAND_POST_ENDPOINT = '...';