Skip to content

Commit c301a5d

Browse files
authored
Merge pull request #3226 from ktran-33/fixingNightmode
Fix: Nightmode Without Refreshing (Partial) Issue #3136
2 parents dc8a52c + 3ec3305 commit c301a5d

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

js&css/extension/www.youtube.com/night-mode/night-mode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ extension.features.schedule = function () {
116116
to = Number((extension.storage.get('schedule_time_to') || '00:00').substr(0, 2));
117117

118118
if (to < from && current > from && current < 24) {
119-
times.to += 24;
119+
to += 24;
120120
} else if (to < from && current < to) {
121121
from = 0;
122122
}

menu/skeleton-parts/night-mode.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,41 @@ extension.skeleton.header.sectionEnd.menu.on.click.nightMode = {
5151
}, {
5252
text: 'systemPeferenceLight',
5353
value: 'system_peference_light'
54-
}]
54+
}],
55+
onchange: function () {
56+
setTimeout(() => {
57+
extension.features.bluelight();
58+
extension.features.dim();
59+
}, 100);
60+
},
5561
},
5662
schedule_time_from: {
5763
component: 'time',
5864
text: 'timeFrom',
5965
variant: 'from',
6066
hour12: function () {
6167
return satus.storage.get('use_24_hour_format') === false;
62-
}
68+
},
69+
onchange: function () {
70+
setTimeout(() => {
71+
extension.features.bluelight();
72+
extension.features.dim();
73+
}, 100);
74+
},
6375
},
6476
schedule_time_to: {
6577
component: 'time',
6678
text: 'timeTo',
6779
variant: 'to',
6880
hour12: function () {
6981
return satus.storage.get('use_24_hour_format') === false;
70-
}
82+
},
83+
onchange: function () {
84+
setTimeout(() => {
85+
extension.features.bluelight();
86+
extension.features.dim();
87+
}, 100);
88+
},
7189
}
7290
}
7391
}

0 commit comments

Comments
 (0)