diff --git a/ui/component/homepageSelector/view.jsx b/ui/component/homepageSelector/view.jsx index f728ad539..b083a3abb 100644 --- a/ui/component/homepageSelector/view.jsx +++ b/ui/component/homepageSelector/view.jsx @@ -1,8 +1,6 @@ // @flow import React from 'react'; -// $FlowFixMe -import homepages from 'homepages'; -import { getLanguageEngName } from 'constants/languages'; +import { getLanguageName } from 'constants/languages'; import { FormField } from 'component/common/form'; import { getDefaultHomepageKey } from 'util/default-languages'; @@ -13,14 +11,18 @@ type Props = { function SelectHomepage(props: Props) { const { homepage, setHomepage } = props; + const homepages = window.homepages || {}; + const homepageKeys = Object.keys(homepages); function handleSetHomepage(e) { const { value } = e.target; setHomepage(value); } - if (Object.keys(homepages).length <= 1) { + + if (homepageKeys.length <= 1) { return null; } + return ( - {Object.keys(homepages).map((hp) => ( + {homepageKeys.map((hp) => ( ))}