mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-24 17:11:00 +00:00
Fixed bug with the audio track skipping on Windows (#143)
Co-authored-by: /home/neo <[email protected]>
This commit is contained in:
@@ -46,7 +46,7 @@ const SettingsView = memo(function SettingsView() {
|
||||
} = useConfig();
|
||||
const {
|
||||
currentTrack,
|
||||
setCurrentTrack,
|
||||
skipTrack,
|
||||
tracks,
|
||||
playPressSound,
|
||||
playBackSound,
|
||||
@@ -73,6 +73,8 @@ const SettingsView = memo(function SettingsView() {
|
||||
const [showModal, setShowModal] = useState<
|
||||
"args" | "prefix" | "envVars" | null
|
||||
>(null);
|
||||
//jandrozdz: Added so track doesn't skip forever after pressing once
|
||||
const isSkippingRef = useRef(false);
|
||||
useEffect(() => {
|
||||
TauriService.getAvailableRunners().then(setRunners);
|
||||
}, [isRunnerDownloading]);
|
||||
@@ -136,8 +138,13 @@ const SettingsView = memo(function SettingsView() {
|
||||
};
|
||||
|
||||
const handleTrackToggle = () => {
|
||||
if (isSkippingRef.current) return;
|
||||
playPressSound();
|
||||
setCurrentTrack((currentTrack + 1) % tracks.length);
|
||||
isSkippingRef.current = true;
|
||||
skipTrack(); //jandrozdz: Use skipTrack here
|
||||
setTimeout(() => {
|
||||
isSkippingRef.current = false;
|
||||
}, 100);
|
||||
};
|
||||
|
||||
const handleResetSetup = () => {
|
||||
|
||||
Reference in New Issue
Block a user