修复&优化听力补偿模块功能
This commit is contained in:
@@ -280,7 +280,8 @@ export default function EffectsPage() {
|
||||
const subwooferHpfOn = (ds?.subwoofer_hpf_enable ?? 0) === 1;
|
||||
const firmwareVersion = parseFirmwareVersion(ds?.version);
|
||||
const showSubwooferFullRange = isFirmwareFeatureAvailable("subwooferFullRange", firmwareVersion);
|
||||
const showHearingCompensation = isFirmwareFeatureAvailable("hearingCompensation", firmwareVersion);
|
||||
// B9: hearing compensation has no firmware version gate — always shown.
|
||||
const showHearingCompensation = true;
|
||||
|
||||
const subwooferDelayMainL = clampSubwooferDelayValue(ds?.subwoofer_delay_main ?? 0);
|
||||
const subwooferDelaySubL = clampSubwooferDelayValue(ds?.subwoofer_delay ?? 0);
|
||||
@@ -917,7 +918,7 @@ export default function EffectsPage() {
|
||||
</button>
|
||||
{hearingOn && hearingProfiles[hearingIdx] && (
|
||||
<HearingCompensationChart
|
||||
className="mt-3 w-full h-[min(42vw,200px)] min-h-[140px] md:h-[260px] lg:h-[300px] rounded-lg bg-black/30"
|
||||
className="mt-3 w-full h-[min(52vw,240px)] min-h-[180px] md:h-[320px] lg:h-[380px] rounded-lg bg-black/30"
|
||||
left={hearingProfiles[hearingIdx].l}
|
||||
right={hearingProfiles[hearingIdx].r}
|
||||
leftLabel={effectText.hearing?.left ?? "Left"}
|
||||
|
||||
@@ -187,10 +187,23 @@ export function consumeSelectPageResult() {
|
||||
|
||||
|
||||
|
||||
// Scroll position of the calling page, captured before navigating to /select.
|
||||
// The select page is short, so the browser clamps window scroll to 0 while on
|
||||
// it; without restoring, the calling page (e.g. Effects) reopens at the top.
|
||||
let selectReturnScroll: number | null = null;
|
||||
|
||||
/** Consume the stored scroll position (once). Returns null when absent. */
|
||||
export function consumeSelectReturnScroll(): number | null {
|
||||
const y = selectReturnScroll;
|
||||
selectReturnScroll = null;
|
||||
return y;
|
||||
}
|
||||
|
||||
// Helper function to set select page state
|
||||
|
||||
export function navigateToSelect(title: string, options: string[], selected: number, back: string, key: string) {
|
||||
|
||||
selectReturnScroll = window.scrollY;
|
||||
selectPageState = { title, options, selected, back, key };
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user