fix(settings): size panel to the active tab + drop the native unload prompt
- Render only the active settings tab instead of stacking all four in one grid cell. The stack forced the whole panel to the tallest tab's (Account) height, leaving the short tabs (Appearance/Notifications) with dead space and a pointless scrollbar. Now the panel sizes to its actual content. - Remove the beforeunload guard: it could only raise the browser's own native 'Reload site?' prompt (no in-app dialog possible there), which we avoid. Unsaved prefs are local-only and revert to the saved server baseline on the next load, so a reload/close loses nothing. The in-app confirm still guards in-app navigation and browser Back.
This commit is contained in:
parent
53ba10e7c6
commit
2e79074fca
2 changed files with 11 additions and 27 deletions
|
|
@ -374,17 +374,9 @@ export default function App() {
|
|||
confirmRef.current = confirm;
|
||||
pageRef.current = page;
|
||||
});
|
||||
|
||||
// Warn on a hard navigation (reload / tab close) while preference changes are unsaved.
|
||||
useEffect(() => {
|
||||
if (!prefsDirty) return;
|
||||
const handler = (e: BeforeUnloadEvent) => {
|
||||
e.preventDefault();
|
||||
e.returnValue = "";
|
||||
};
|
||||
window.addEventListener("beforeunload", handler);
|
||||
return () => window.removeEventListener("beforeunload", handler);
|
||||
}, [prefsDirty]);
|
||||
// No beforeunload guard: a reload/close can only raise the browser's own native prompt
|
||||
// (we can't show our in-app confirm there), and unsaved prefs are local-only — they
|
||||
// revert to the saved server baseline on the next load — so there's nothing to lose.
|
||||
|
||||
if (meQuery.isLoading)
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue