Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
fix(time): Cycles in time skip settings not restored
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Oct 14, 2022
1 parent ddb749e commit ec5ffad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/userscript/source/options/TimeSkipSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export class TimeSkipSettings extends SettingTrigger {
options.summer = subject.items["toggle-timeSkip-summer"] ?? options.summer;
options.winter = subject.items["toggle-timeSkip-winter"] ?? options.winter;

for (let cycleIndex = 0; cycleIndex < 10; ++cycleIndex) {
options[cycleIndex as CycleIndices] =
subject.items[`toggle-timeSkip-${cycleIndex as CycleIndices}` as const] ??
options[cycleIndex as CycleIndices];
}

return options;
}
}
7 changes: 6 additions & 1 deletion packages/userscript/source/ui/components/CyclesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export class CyclesList extends SettingsList {
}

refreshUi() {
/* intentionally left blank */
for (let cycleIndex = 0; cycleIndex < 10; ++cycleIndex) {
$("input", this[cycleIndex as CycleIndices]).prop(
"checked",
this.setting[cycleIndex as CycleIndices]
);
}
}
}

0 comments on commit ec5ffad

Please sign in to comment.