From 0b8d0f7010d7b55b6c1fc5aec15ac319b5a47079 Mon Sep 17 00:00:00 2001 From: Mohamed El Mahallawy Date: Thu, 19 Jan 2017 23:18:30 -0800 Subject: [PATCH] Fixes #598 Reading mode missing text (#600) --- src/components/Line/index.js | 21 ++++++++++++--------- src/components/Word/index.js | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/components/Line/index.js b/src/components/Line/index.js index c2600ef7d..585354fe1 100644 --- a/src/components/Line/index.js +++ b/src/components/Line/index.js @@ -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; diff --git a/src/components/Word/index.js b/src/components/Word/index.js index 8cc409196..1e81d4d7a 100644 --- a/src/components/Word/index.js +++ b/src/components/Word/index.js @@ -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 (