quran / quran.com-frontend

quran.com frontend
https://quran.com
MIT License
990 stars 361 forks source link

Surah page needs to be refreshed for custom options to apply #550

Closed umairidris closed 7 years ago

umairidris commented 7 years ago

I am hitting a bug where my options (such as reciters, translations, reading mode, etc) get reset (when going to a surah from the quran.com homepage) and need to be refreshed. Sometimes a change in setting needs a refresh too in order to be applied.

Steps to reproduce:

Additional Info:

If this is a legitimate bug I can try to tackle it when I get a chance.

SanPilot commented 7 years ago

I've dug around a little - I don't know the cause but can help.

The settings are stored in a cookie named 'options'. When I change the Reciter, for example, the cookie, which is URL encoded JSON, changes to my new setting (in this case, the "audio" property changes).

Strangely, when I go from quran.com/1 to the homepage and back to quran.com/1, the cookie remains but the setting is not applied. The issue seems to be that the page is ignoring the cookie.

This behavior is particularly curious since, like OP said, navigating to a different Surah does not cause the issue.

mmahalwy commented 7 years ago

@umairidris @SanPilot thanks for looking into this issue. Might be great to centralize the options into one place and add this feature request: https://github.com/quran/quran.com-frontend/issues/552