quran / quran.com-frontend

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

Night mode is not persistent #676

Closed murad073 closed 7 years ago

murad073 commented 7 years ago

I was listening surah 114 in night mode. While I changed the url to listen surah 36, the night mode is gone. I think night mode setting should be stored in local-storage. Currently any type of refresh could reset the night-mode.

image

umairidris commented 7 years ago

Settings like reciters, etc are already stored in an options cookie, is night mode not being stored there? Did you try refreshing the page? This may be the same as #550 where the options didn't get applied due to a timing bug.

murad073 commented 7 years ago

refreshing also reset the night mode.

mmahalwy commented 7 years ago

It's not being stored! Need to store it

naveed-ahmad commented 7 years ago

this was intentional, you enable night mode only on nights :)

But yes we can have cookie which last only 4-8 hours.

thabti commented 7 years ago

@naveed-ahmad we can try to work out the time of the day and dis/nable it accordingly?

naveed-ahmad commented 7 years ago

timezone could make this simple toggle switch very complex imo @sabeurthabti also sorry I'm not that good in reactjs :( for now I'm just saving to in options cookies. We can work on intelligent night mode later on :) thoughts ?

naveed-ahmad commented 7 years ago

Maybe I'm missing something.

mmahalwy commented 7 years ago

i can help on this too.

naveed-ahmad commented 7 years ago

@sabeurthabti @mmahalwy feel free to take over from https://github.com/quran/quran.com-frontend/pull/692 and make night mode timezone/day aware :)

mmahalwy commented 7 years ago

too difficult. plus, I like to see Quran.com in white bg all times. would be bothered if it changed by itself, personally.