Skip to content

Commit

Permalink
make sure page.state is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeh committed Mar 1, 2020
1 parent ec645db commit 5bcfe1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tasks/prepare/blogPost.mjs
Expand Up @@ -65,6 +65,8 @@ export const prepareBlogPost = ({ WEB_ROOT, PAGES, state = {}, modules = [] }) =

page.file = file

// has to be initialized!
page.state = {}

if (!is.empty(transmuted.originalState)) {
if (is.fn(transmuted.originalState)) {
Expand Down
3 changes: 3 additions & 0 deletions src/tasks/prepare/page.mjs
Expand Up @@ -54,6 +54,9 @@ export const preparePage = ({ WEB_ROOT, PAGES, state = {}, modules = [] }) => as

page.file = file

// has to be initialized!
page.state = {}

if (!is.empty(transmuted.originalState)) {
if (is.fn(transmuted.originalState)) {
transmuted.originalState = transmuted.originalState(config)
Expand Down

0 comments on commit 5bcfe1a

Please sign in to comment.