Update locale files for English, Traditional Chinese, and Simplified Chinese to include new effect titles and crossfeed options; refactor EffectsPage to utilize localized labels and improve state management for audio effects.
This commit is contained in:
@@ -155,7 +155,7 @@ export default function Home() {
|
||||
}
|
||||
}, [api, disconnect, isDemoMode, homeText]);
|
||||
|
||||
/** HP-EQ 圆钮:单击进入 /eq;双击在 280ms 内第二次点击则切换 peqEnable(与 info.cgi?action=setting&peqEnable=0|1 一致) */
|
||||
/** HP-EQ 圆钮:单击在短延迟后切换 peqEnable(避免与双击抢);280ms 内第二次点击则取消开关并进入 /eq */
|
||||
const HP_EQ_DOUBLE_CLICK_MS = 280;
|
||||
const handleHpEqCircleClick = useCallback(() => {
|
||||
const now = Date.now();
|
||||
@@ -166,8 +166,7 @@ export default function Home() {
|
||||
clearTimeout(hpEqNavigateTimerRef.current);
|
||||
hpEqNavigateTimerRef.current = null;
|
||||
}
|
||||
const on = (deviceState?.peqEnable ?? 0) === 1;
|
||||
void updateSetting({ peqEnable: on ? 0 : 1 });
|
||||
setLocation("/eq");
|
||||
return;
|
||||
}
|
||||
hpEqLastTapRef.current = now;
|
||||
@@ -175,11 +174,12 @@ export default function Home() {
|
||||
hpEqNavigateTimerRef.current = setTimeout(() => {
|
||||
hpEqNavigateTimerRef.current = null;
|
||||
hpEqLastTapRef.current = null;
|
||||
setLocation("/eq");
|
||||
const on = (deviceState?.peqEnable ?? 0) === 1;
|
||||
void updateSetting({ peqEnable: on ? 0 : 1 });
|
||||
}, HP_EQ_DOUBLE_CLICK_MS);
|
||||
}, [deviceState?.peqEnable, updateSetting, setLocation]);
|
||||
|
||||
/** Effect 圆钮:单击进入 /effects;双击切换 audio_enable */
|
||||
/** Effect 圆钮:单击短延迟后切换 audio_enable;280ms 内第二次点击则进入 /effects */
|
||||
const handleEffectCircleClick = useCallback(() => {
|
||||
const now = Date.now();
|
||||
const last = effectLastTapRef.current;
|
||||
@@ -189,8 +189,7 @@ export default function Home() {
|
||||
clearTimeout(effectNavigateTimerRef.current);
|
||||
effectNavigateTimerRef.current = null;
|
||||
}
|
||||
const on = (deviceState?.audio_enable ?? 0) === 1;
|
||||
void updateSetting({ audio_enable: on ? 0 : 1 });
|
||||
setLocation("/effects");
|
||||
return;
|
||||
}
|
||||
effectLastTapRef.current = now;
|
||||
@@ -198,7 +197,8 @@ export default function Home() {
|
||||
effectNavigateTimerRef.current = setTimeout(() => {
|
||||
effectNavigateTimerRef.current = null;
|
||||
effectLastTapRef.current = null;
|
||||
setLocation("/effects");
|
||||
const on = (deviceState?.audio_enable ?? 0) === 1;
|
||||
void updateSetting({ audio_enable: on ? 0 : 1 });
|
||||
}, HP_EQ_DOUBLE_CLICK_MS);
|
||||
}, [deviceState?.audio_enable, updateSetting, setLocation]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user