Skip to content

Commit

Permalink
ReadChapter page fix
Browse files Browse the repository at this point in the history
  • Loading branch information
klyburke committed Jun 2, 2022
1 parent a15e075 commit 0c193dd
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion book/5-end/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ReadChapter extends React.Component {
const { htmlContent } = prevProps.chapter;

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
2 changes: 1 addition & 1 deletion book/6-begin/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ReadChapter extends React.Component {
const { htmlContent } = prevProps.chapter;

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
2 changes: 1 addition & 1 deletion book/6-end/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ReadChapter extends React.Component {
const { htmlContent } = prevProps.chapter;

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
2 changes: 1 addition & 1 deletion book/7-begin/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ReadChapter extends React.Component {
const { htmlContent } = prevProps.chapter;

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
2 changes: 1 addition & 1 deletion book/7-end/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ReadChapter extends React.Component {
const { htmlContent } = prevProps.chapter;

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
2 changes: 1 addition & 1 deletion book/8-begin/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ReadChapter extends React.Component {
const { htmlContent } = prevProps.chapter;

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
6 changes: 3 additions & 3 deletions book/8-end/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ class ReadChapter extends React.Component {
document.getElementById('chapter-content').scrollIntoView();
let htmlContent = '';
if (prevProps.chapter && (prevProps.chapter.isPurchased || prevProps.chapter.isFree)) {
htmlContent = prevProps.chapter.htmlContent;
htmlContent = this.props.chapter.htmlContent;
} else {
htmlContent = prevProps.chapter.htmlExcerpt;
htmlContent = this.props.chapter.htmlExcerpt;
}

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down
6 changes: 3 additions & 3 deletions book/9-begin/pages/public/read-chapter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ class ReadChapter extends React.Component {
document.getElementById('chapter-content').scrollIntoView();
let htmlContent = '';
if (prevProps.chapter && (prevProps.chapter.isPurchased || prevProps.chapter.isFree)) {
htmlContent = prevProps.chapter.htmlContent;
htmlContent = this.props.chapter.htmlContent;
} else {
htmlContent = prevProps.chapter.htmlExcerpt;
htmlContent = this.props.chapter.htmlExcerpt;
}

// eslint-disable-next-line
this.setState({ chapter: prevProps.chapter, htmlContent });
this.setState({ chapter: this.props.chapter, htmlContent });
}
}

Expand Down

0 comments on commit 0c193dd

Please sign in to comment.