Skip to content

Commit

Permalink
make applying settings and menu initialization parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
GooseOb committed Dec 11, 2024
1 parent ddadcb7 commit e356e27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 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.8",
"version": "1.11.9",
"repository": {
"type": "git",
"url": "git+https://github.com/GooseOb/YT-Defaulter.git"
Expand Down
17 changes: 10 additions & 7 deletions src/listeners/on-video-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ import * as menu from '../menu';

export const onVideoPage = async () => {
const aboveTheFold = await untilAppear(get.aboveTheFold);

config.channel.username =
(await untilAppear(get.channelUsernameElementGetter(aboveTheFold))).href ||
'';

await plr.set(await untilAppear(get.plr));

const doNotChangeSpeed =
config.value.flags.standardMusicSpeed &&
!!get.artistChannelBadge(aboveTheFold);
untilAppear(get.plr)
.then((plrElement) => plr.set(plrElement))
.then(() => {
const doNotChangeSpeed =
config.value.flags.standardMusicSpeed &&
!!get.artistChannelBadge(aboveTheFold);

applySettings(computeSettings(doNotChangeSpeed));
applySettings(computeSettings(doNotChangeSpeed));
});

if (menu.value.element) {
menu.controls.updateThisChannel(config.channel.get());
} else {
await menu.init();
menu.init();
}
};

0 comments on commit e356e27

Please sign in to comment.