Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/ensureSignedIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import React from 'react'

const ensureSignedIn = Page => {
return class EnsureSignedIn extends React.Component {
static getInitialProps (context) {
static async getInitialProps (context) {
// If the page has a prop fetcher invoke it
return Page.getInitialProps ? Page.getInitialProps(context) : {}
return Page.getInitialProps ? await Page.getInitialProps(context) : {}
}

constructor (props) {
Expand Down
4 changes: 2 additions & 2 deletions components/injectEnvironmentVar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const injectEnvironmentVar = varName => Page => {
}

return class InjectEnvironmentVar extends React.Component {
static getInitialProps (context) {
static async getInitialProps (context) {
// Get the page's own initial props
const initialProps = Page.getInitialProps ? Page.getInitialProps(context) : {}
const initialProps = Page.getInitialProps ? await Page.getInitialProps(context) : {}
// Dig the specified environment variables up from the
// appropriate sources
const env = process.browser ? global.__next_env : process.env
Expand Down
4 changes: 2 additions & 2 deletions components/injectSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const injectSession = Page => {
this.state = {}
}

static getInitialProps (context) {
static async getInitialProps (context) {
// Get the page's own initial props
const initialProps = Page.getInitialProps ? Page.getInitialProps(context) : {}
const initialProps = Page.getInitialProps ? await Page.getInitialProps(context) : {}

// Dig the session out of localstorage (on client) or the request (on
// server)
Expand Down
4 changes: 2 additions & 2 deletions components/wrapWithLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import Menu from './Menu'

const wrapWithLayout = Page => {
return class WrapWithLayout extends React.Component {
static getInitialProps (context) {
static async getInitialProps (context) {
return Page.getInitialProps
? Page.getInitialProps(context)
? await Page.getInitialProps(context)
: {}
}

Expand Down