diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-04-12 16:31:01 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-04-12 16:31:01 -0400 |
| commit | 97b6de6aa437f7a913a33b9e6aa18a919faf2caf (patch) | |
| tree | 431e12a535baf1d2ad59601ee7c5e8084ae7a263 /frontend/components/Page.js | |
| parent | d22616d5a675f5a381c741784333151255713b45 (diff) | |
a whole bunch of things that should be in their own commits
Diffstat (limited to 'frontend/components/Page.js')
| -rw-r--r-- | frontend/components/Page.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/frontend/components/Page.js b/frontend/components/Page.js index 3c6e3b1..ab14b10 100644 --- a/frontend/components/Page.js +++ b/frontend/components/Page.js @@ -51,10 +51,15 @@ const StyledPage = styled.div` `; class Page extends React.Component { + static propTypes = { + children: PropTypes.node.isRequired, + }; componentDidMount() { - // console.log('ComponentDidMount'); - // When the page loads, re-refetch the current user query - // client.query({ query: CURRENT_USER_QUERY, fetchPolicy: 'network-only' }); + // The first time we load in the client, we need to refetch the current user data + if (typeof window !== 'undefined' && !window.__CLIENTLOADED__) { + client.query({ query: CURRENT_USER_QUERY, fetchPolicy: 'network-only' }); + window.__CLIENTLOADED__ = true; + } } render() { return ( @@ -68,8 +73,5 @@ class Page extends React.Component { ); } } -Page.propTypes = { - children: PropTypes.node.isRequired, -}; export default Page; |
