raphaelquintao / QRedshiftCinnamon

Linux Cinnamon applet to change screen color temperature
https://cinnamon-spices.linuxmint.com/applets/view/313
Apache License 2.0
96 stars 13 forks source link

this.opt.period value is "-" during applet execution, breaking 'show label' (labeltext) #11

Closed AtilioA closed 4 years ago

AtilioA commented 4 years ago

this.opt.period on the right when applet is active: image My location settings: image

This leads to this.opt.enabledNight && this.opt.period.toLowerCase() == 'night' being false and label showing day settings despite night mode being active. If I simply remove the && this.opt.period.toLowerCase() == 'night' condition, it works fine (since this.opt.enabledNight is true). Is there a reason for needing another check besides this.opt.enabledNight? Or perhaps this should be an OR condition instead?

Screenshot depicting the problem: image

AtilioA commented 4 years ago

If I simply remove the && this.opt.period.toLowerCase() == 'night' condition, it works fine

Just realized that doing this breaks the label during the day. enabledNight refers only to whether QRedshift should have different settings at night, not if it is actually using night settings. Anyways, my problem remains.

raphaelquintao commented 4 years ago

You use your Linux in Portuguese that's the problem i guess. Try change the language to English just to test.

AtilioA commented 4 years ago

Yes, it works if I change to English.

raphaelquintao commented 4 years ago

I will think in something to fix it!

raphaelquintao commented 4 years ago

Fixed in version 1.5.2.

I fixed it by this.opt.enabledNight && this.opt.period.toLowerCase().startsWith("n"). I just test if the period string start with n, if true show night info. It should work for all language that night start with n, in Portuguese will work fine. But will not work for strange languages.