Fix: Volume-Slider reaktionsschneller (Latenz reduziert)
- Server: writeState() → writeStateDebounced() im Volume-Endpoint (kein synchroner Disk-Write bei jedem Slider-Tick mehr) - Frontend: Debounce von 120ms auf 50ms reduziert Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
25e47fb093
commit
7ed6b81584
4 changed files with 4 additions and 4 deletions
|
|
@ -1064,7 +1064,7 @@ const soundboardPlugin: Plugin = {
|
||||||
if (state.currentResource?.volume) state.currentResource.volume.setVolume(safeVol);
|
if (state.currentResource?.volume) state.currentResource.volume.setVolume(safeVol);
|
||||||
}
|
}
|
||||||
persistedState.volumes[guildId] = safeVol;
|
persistedState.volumes[guildId] = safeVol;
|
||||||
writeState();
|
writeStateDebounced();
|
||||||
sseBroadcast({ type: 'soundboard_volume', plugin: 'soundboard', guildId, volume: safeVol });
|
sseBroadcast({ type: 'soundboard_volume', plugin: 'soundboard', guildId, volume: safeVol });
|
||||||
res.json({ ok: true, volume: safeVol });
|
res.json({ ok: true, volume: safeVol });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
2
web/dist/index.html
vendored
2
web/dist/index.html
vendored
|
|
@ -5,7 +5,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Gaming Hub</title>
|
<title>Gaming Hub</title>
|
||||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎮</text></svg>" />
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎮</text></svg>" />
|
||||||
<script type="module" crossorigin src="/assets/index-CUixApZu.js"></script>
|
<script type="module" crossorigin src="/assets/index-CqHVUt2T.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BrwtipcK.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-BrwtipcK.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -1009,7 +1009,7 @@ export default function SoundboardTab({ data, isAdmin: isAdminProp }: Soundboard
|
||||||
if (volDebounceRef.current) clearTimeout(volDebounceRef.current);
|
if (volDebounceRef.current) clearTimeout(volDebounceRef.current);
|
||||||
volDebounceRef.current = setTimeout(() => {
|
volDebounceRef.current = setTimeout(() => {
|
||||||
apiSetVolumeLive(guildId, v).catch(() => {});
|
apiSetVolumeLive(guildId, v).catch(() => {});
|
||||||
}, 120);
|
}, 50);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
style={{ '--vol': `${Math.round(volume * 100)}%` } as React.CSSProperties}
|
style={{ '--vol': `${Math.round(volume * 100)}%` } as React.CSSProperties}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue