修复&优化听力补偿模块功能
This commit is contained in:
@@ -185,10 +185,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