Skip to content

Commit

Permalink
move functions that do not interact with UI out of `restoreFocusAfter…
Browse files Browse the repository at this point in the history
…` callback
  • Loading branch information
GooseOb committed Dec 8, 2024
1 parent 1f745b4 commit 4809aa2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yt-defaulter",
"author": "GooseOb",
"version": "1.11.5",
"version": "1.11.6",
"repository": {
"type": "git",
"url": "git+https://github.com/GooseOb/YT-Defaulter.git"
Expand Down
10 changes: 5 additions & 5 deletions src/player/apply-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { plr } from './plr';
import { valueSetters } from './value-setters';

export const applySettings = (settings: Cfg) => {
restoreFocusAfter(() => {
if (!isNaN(+settings.customSpeed)) {
valueSetters.customSpeed(settings.customSpeed);
}
if (!isNaN(+settings.customSpeed)) {
valueSetters.customSpeed(settings.customSpeed);
}

delete settings.customSpeed;
delete settings.customSpeed;

restoreFocusAfter(() => {
for (const setting in settings) {
valueSetters[setting as Setting](settings[setting as never]);
}
Expand Down

0 comments on commit 4809aa2

Please sign in to comment.