feat: code splitting (#3593)

Co-authored-by: Angelos Bouklis <me@arjix.dev>
This commit is contained in:
JellyBrick
2025-07-12 00:00:03 +09:00
committed by GitHub
parent c04dc92d39
commit b53ece5836
15 changed files with 189 additions and 120 deletions

View File

@ -45,7 +45,7 @@ export const onPlayerApiReady = async (
}, 2500);
/** Restore saved volume and setup tooltip */
function firstRun() {
async function firstRun() {
if (typeof options.savedVolume === 'number') {
// Set saved volume as tooltip
setTooltip(options.savedVolume);
@ -66,7 +66,7 @@ export const onPlayerApiReady = async (
injectVolumeHud(noVid);
if (!noVid) {
setupVideoPlayerOnwheel();
if (!window.mainConfig.plugins.isEnabled('video-toggle')) {
if (!await window.mainConfig.plugins.isEnabled('video-toggle')) {
// Video-toggle handles hud positioning on its own
const videoMode = () =>
api.getPlayerResponse().videoDetails?.musicVideoType !==
@ -280,7 +280,7 @@ export const onPlayerApiReady = async (
);
context.ipc.on('setVolume', (value: number) => setVolume(value));
firstRun();
await firstRun();
};
export const onConfigChange = (config: PreciseVolumePluginConfig) => {