mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 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:
parent
bee7e6e1bf
commit
88af30f855
1 changed files with 5 additions and 1 deletions
|
@ -119,7 +119,11 @@ export default Service.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_setAdminTheme(enabled) {
|
_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(() => {
|
return this.get('lazyLoader').loadStyle('dark', 'assets/ghost-dark.css', true).then(() => {
|
||||||
$('link[title=dark]').prop('disabled', !nightShift);
|
$('link[title=dark]').prop('disabled', !nightShift);
|
||||||
|
|
Loading…
Add table
Reference in a new issue