Skip to content

Commit c99253b

Browse files
committed
Bugfix update: schedule was trigerrig the wrong actions! Oopsie.
1 parent 292af69 commit c99253b

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

launcher.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,19 +342,18 @@ function scheduleLoader() {
342342
});
343343
if (schedules.length > 0 && (!scheduledActionInfo.lastExecution || (d - scheduledActionInfo.lastExecution) / 1000 / 60 / 60 > 12) && (!scheduledActionInfo.lastSkip || (d - scheduledActionInfo.lastSkip) / 1000 / 60 / 60 > 12)) {
344344
if ($("#home:visible").length > 0) {
345-
for (var schedule of schedules) {
345+
for (var s = 0; s < schedules.length; s++) {
346+
let schedule = schedules[s];
346347
if (d.getDay() == schedule.triggerDay) {
347348
let triggerTime = schedule.triggerTime.split(":");
348349
let targetDate = new Date(d);
349350
targetDate.setHours(triggerTime[0], triggerTime[1], 0, 0);
350351
let timeToEvent = (targetDate - d) / 1000 / 60;
351352
if (timeToEvent >=-105 && timeToEvent <= 30) {
352353
console.log("[SCHEDULE] Triggering scheduled item, as we are within the acceptable timeframe");
353-
$("#actionDesc").text($(".schedule tbody tr .targetAction").eq(schedule.targetAction).find("option:selected").text());
354+
$("#actionDesc").text($(".schedule tbody tr .targetAction").eq(s).find("option:selected").text());
354355
$("#overlayScheduledAction").stop().fadeIn().delay(10000).fadeOut(400, function() {
355-
if (!scheduledActionInfo.lastSkip || (d - scheduledActionInfo.lastSkip) / 1000 / 60 / 60 > 12) {
356-
$(".actions button").eq(schedule.targetAction).click();
357-
}
356+
if (!scheduledActionInfo.lastSkip || (d - scheduledActionInfo.lastSkip) / 1000 / 60 / 60 > 12) $(".actions button").eq(schedule.targetAction).click();
358357
});
359358
let timeLeft = 10;
360359
let downloadTimer = setInterval(function(){

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jw-launcher",
3-
"version": "21.12.0",
3+
"version": "21.12.1",
44
"description": "JW Launcher",
55
"main": "main.js",
66
"repository": {

0 commit comments

Comments
 (0)