🐛 Fixed need to click Night Shift toggle 3 times in certain circumstances (#965)

closes TryGhost/Ghost#9471
- added check for undefined value
- fixed the condition in feature.js _setAdminTheme
This commit is contained in:
Hey24sheep 2018-03-09 15:04:43 +05:30 committed by Kevin Ansfield
parent bee7e6e1bf
commit 88af30f855

View File

@ -119,7 +119,11 @@ export default Service.extend({
},
_setAdminTheme(enabled) {
let nightShift = enabled || this.get('nightShift');
let nightShift = enabled;
if (typeof nightShift === 'undefined') {
nightShift = enabled || this.get('nightShift');
}
return this.get('lazyLoader').loadStyle('dark', 'assets/ghost-dark.css', true).then(() => {
$('link[title=dark]').prop('disabled', !nightShift);