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

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahalwy committed Apr 19, 2017
2 parents b065df9 + 230eaf5 commit d94783c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/components/Audioplayer/RepeatDropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class RepeatButton extends Component {
value={repeat.from}
onChange={(event) => {
let to = parseInt(event.target.value, 10) + 3;
to = to < chapter.ayat ? to : chapter.ayat;
to = to < chapter.versesCount ? to : chapter.versesCount;

setRepeat({
...repeat,
from: parseInt(event.target.value, 10),
Expand All @@ -71,7 +72,7 @@ class RepeatButton extends Component {
>
{
array.reduce((options, ayah, index) => {
if (index + 1 < chapter.ayat) { // Exclude last verse
if (index + 1 < chapter.versesCount) { // Exclude last verse
options.push(
<option key={index} value={index + 1}>
{index + 1}
Expand All @@ -97,7 +98,7 @@ class RepeatButton extends Component {
>
{
array.reduce((options, ayah, index) => {
if ((repeat.from ? repeat.from : 1) < index + 1 && index + 1 <= chapter.ayat) {
if ((repeat.from ? repeat.from : 1) < index + 1 && index + 1 <= chapter.versesCount) { // eslint-disable-line max-len
options.push(
<option key={index} value={index + 1}>
{index + 1}
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Surah/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,17 @@ function mapStateToProps(state, ownProps) {
const verseIds = new Set(verseArray);
const lastAyahInArray = verseArray.slice(-1)[0];
const isSingleAyah = !!ownProps.params.range && !ownProps.params.range.includes('-');

const currentVerse = state.audioplayer.currentVerse || Object.keys(verses)[0];

return {
chapter,
verses,
verseIds,
isSingleAyah,
currentVerse,
info: state.chapters.infos[ownProps.params.chapterId],
isStarted: state.audioplayer.isStarted,
isPlaying: state.audioplayer.isPlaying,
currentVerse: state.audioplayer.currentVerse,
isAuthenticated: state.auth.loaded,
currentWord: state.verses.currentWord,
isEndOfSurah: lastAyahInArray === chapter.versesCount,
Expand Down
14 changes: 14 additions & 0 deletions src/helpers/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ const Html = ({ store, component, assets }) => {
</head>
<body>
<div id="app" dangerouslySetInnerHTML={{ __html: content }} />
<style
dangerouslySetInnerHTML={{
__html: '.async-hide { opacity: 0 !important}'
}}
/>
<script
dangerouslySetInnerHTML={{
__html: `(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(window,document.documentElement,'async-hide','dataLayer',4000,
{'GTM-PNMFTW3':true});`
}}
/>
<script
dangerouslySetInnerHTML={{
__html: `(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
12 changes: 6 additions & 6 deletions src/redux/modules/lines.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ export default function reducer(state = initialState, action = {}) {
const ayah = ayahs[ayahId];

ayah.words.forEach((word) => {
if (lines[`${word.pageNum}-${word.lineNum}`]) {
const isInArray = lines[`${word.pageNum}-${word.lineNum}`].find((item) => {
const itemChecksum = `${item.lineNum}${item.code}${item.verseKey}${item.position}`;
const dataChecksum = `${word.lineNum}${word.code}${word.verseKey}${item.position}`;
if (lines[`${word.pageNumber}-${word.lineNumber}`]) {
const isInArray = lines[`${word.pageNumber}-${word.lineNumber}`].find((item) => {
const itemChecksum = `${item.lineNumber}${item.code}${item.verseKey}${item.position}`;
const dataChecksum = `${word.lineNumber}${word.code}${word.verseKey}${item.position}`;

return itemChecksum === dataChecksum;
});

if (!isInArray) {
lines[`${word.pageNum}-${word.lineNum}`].push(word);
lines[`${word.pageNumber}-${word.lineNumber}`].push(word);
}
} else {
lines[`${word.pageNum}-${word.lineNum}`] = [word];
lines[`${word.pageNumber}-${word.lineNumber}`] = [word];
}
});
});
Expand Down

0 comments on commit d94783c

Please sign in to comment.