site: fix banner ssr

This commit is contained in:
afc163 2017-12-23 17:33:33 +08:00
parent cbfa987b0b
commit dd7410e151

View File

@ -31,7 +31,7 @@ const promoteBannerImageUrl = 'https://gw.alipayobjects.com/zos/rmsportal/qVVhew
class Home extends React.Component {
constructor(props) {
super(props);
const adBannerClosed = typeof window !== 'undefined' ? true : (
const adBannerClosed = typeof window === 'undefined' ? true : (
window.localStorage &&
window.localStorage.getItem(`adBannerClosed-${promoteBannerImageUrl}`) === 'true'
);