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

Commit

Permalink
chapter for repeat dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahalwy committed Mar 3, 2017
1 parent 9a1696b commit 91ec340
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/Audioplayer/RepeatDropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RepeatButton extends Component {
value={repeat.from}
onChange={(event) => {
let to = parseInt(event.target.value, 10) + 3;
to = to < surah.ayat ? to : surah.ayat;
to = to < chapter.ayat ? to : chapter.ayat;
setRepeat({
...repeat,
from: parseInt(event.target.value, 10),
Expand All @@ -84,7 +84,7 @@ class RepeatButton extends Component {
>
{
array.reduce((options, ayah, index) => {
if (index + 1 < surah.ayat) { // Exclude last verse
if (index + 1 < chapter.ayat) { // Exclude last verse
options.push(
<option key={index} value={index + 1}>
{index + 1}
Expand All @@ -110,7 +110,7 @@ class RepeatButton extends Component {
>
{
array.reduce((options, ayah, index) => {
if ((repeat.from ? repeat.from : 1) < index + 1 && index + 1 <= surah.ayat) {
if ((repeat.from ? repeat.from : 1) < index + 1 && index + 1 <= chapter.ayat) {
options.push(
<option key={index} value={index + 1}>
{index + 1}
Expand Down
2 changes: 1 addition & 1 deletion src/redux/actions/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function search(params) {
types: [SEARCH, SEARCH_SUCCESS, SEARCH_FAIL],
schema: { results: [{ ayah: versesSchema }] },
// TODO: We are doing this because of a weird obj.hasOwnProperty method missing on `params`
promise: client => client.get('/v2/search', { params: { q: params.q, p: params.p } }),
promise: client => client.get('/api/v3/search', { params: { q: params.q, p: params.p } }),
params
};
}
Expand Down

0 comments on commit 91ec340

Please sign in to comment.