Skip to content

Commit

Permalink
fix issue #29
Browse files Browse the repository at this point in the history
  • Loading branch information
kmsheng committed Sep 25, 2015
1 parent 73b55b7 commit 6f48487
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/EditorArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,12 @@ export default class EditorArea extends React.Component {

let page = doc.pages[pageIndex];
let startKeyword = '';
let pageContent = page.content || '';

// find start keyword
if ((pageIndex > 0) && _.isEmpty(page.content)) {
if ((pageIndex > 0) && _.isEmpty(pageContent)) {
let previousPage = doc.pages[pageIndex - 1];
let previousPageContent = previousPage.content;
let previousPageContent = previousPage.content || '';
let previousPageLength = previousPageContent.length;

if (previousPageLength > 60) {
Expand Down Expand Up @@ -566,7 +567,7 @@ export default class EditorArea extends React.Component {
className: classNames({'editor': true, 'hidden': editChunk}),
pageIndex,
onInputChange: ::this.onInputChange,
code: page.content,
code: page.content || '',
ref: editorKey,
key: editorKey,
settings: this.props.settings,
Expand Down

0 comments on commit 6f48487

Please sign in to comment.