Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Commit

Permalink
Fixes #598 Reading mode missing text (#600)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahalwy authored Jan 20, 2017
1 parent 73c5bd4 commit 0b8d0f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions src/components/Line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ export default class Line extends React.Component {
isPlaying: PropTypes.bool
};

shouldComponentUpdate(nextProps) {
const conditions = [
this.props.currentAyah !== nextProps.currentAyah,
this.props.line !== nextProps.line,
this.props.isPlaying !== nextProps.isPlaying
];

return conditions.some(condition => condition);
}
// NOTE: this is commented out as it caused problems with 55:31 with missing text.
// shouldComponentUpdate(nextProps) {
// const conditions = [
// this.props.currentAyah !== nextProps.currentAyah,
// this.props.line !== nextProps.line,
// this.props.isPlaying !== nextProps.isPlaying
// ];
//
// console.log(conditions, conditions.some(condition => condition));
//
// return conditions.some(condition => condition);
// }

renderText() {
const { tooltip, currentAyah, audioActions, isPlaying, line } = this.props;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Word/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class Word extends React.Component {
const className = `${word.className} ${highlight} ${word.highlight ? word.highlight : ''}`;

if (word.charTypeId === CHAR_TYPE_WORD) {
id = `word-${word.ayahKey.replace(/:/, '-')}-${audioPosition}`;
id = `word-${word.ayahKey.replace(/:/, '-')}-${audioPosition || word.position}`;
}

return (
Expand Down

0 comments on commit 0b8d0f7

Please sign in to comment.