quran / quran.com-frontend

quran.com frontend
https://quran.com
MIT License
996 stars 360 forks source link

Unable to turn of all translations #862

Open azizur opened 7 years ago

azizur commented 7 years ago

It's not possible to remove/turn off all translations.

When you remove Translations using "Remove All" button screen shot 2017-09-15 at 08 40 18

When you choose a translation. screen shot 2017-09-15 at 08 40 39

bahaa96 commented 6 years ago

Is this Issue still open ??

naveed-ahmad commented 6 years ago

@bahaa96 yes

aliasaria commented 6 years ago

Haven't had time to fully look at this bug but FYI to anyone looking at it, the issue goes away if you change:

https://github.com/quran/quran.com-frontend/blob/c4e2d9943c980e71ab63f6cf43f82dbc6763c6b4/src/redux/actions/verses.js#L20-L22

from

const defaultOptions = {
  translations: [102]  
};

to

const defaultOptions = {
  translations: []
};

I'm not sure what else breaks when you do this. It seems like an issue in the prepareParams function if translations is empty because it doesn't handle the empty case in the if statement.

naveed-ahmad commented 6 years ago

But we want to show default translation when user load the page initially.

aliasaria commented 6 years ago

Yes my note above isn't a fix. Just wanted to jot down a note so that if someone else picks this up they know where to start looking.

mmahalwy commented 6 years ago

I can pick it up soon

rdhia commented 5 years ago