mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
chore(settings): reset uiScale to 1.0 on startup while scaling is disabled
Users who had previously set a custom scale are silently reset to 100% on next launch so they are not stuck at a broken zoom level. The stored value is cleared in fontStore so the slider starts at 100% once the feature is re-enabled. Also credits nisrael for the ICY / AzuraCast PR #146. TODO: remove the reset effect and re-enable the slider in Settings.tsx when UI scaling is properly reworked. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -557,6 +557,7 @@ export default function App() {
|
|||||||
const effectiveTheme = useThemeScheduler();
|
const effectiveTheme = useThemeScheduler();
|
||||||
const font = useFontStore(s => s.font);
|
const font = useFontStore(s => s.font);
|
||||||
const uiScale = useFontStore(s => s.uiScale);
|
const uiScale = useFontStore(s => s.uiScale);
|
||||||
|
const setUiScale = useFontStore(s => s.setUiScale);
|
||||||
const [exportPickerOpen, setExportPickerOpen] = useState(false);
|
const [exportPickerOpen, setExportPickerOpen] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -567,6 +568,14 @@ export default function App() {
|
|||||||
document.documentElement.setAttribute('data-font', font);
|
document.documentElement.setAttribute('data-font', font);
|
||||||
}, [font]);
|
}, [font]);
|
||||||
|
|
||||||
|
// TODO(ui-scale): UI scaling is disabled pending a cross-platform rework.
|
||||||
|
// Reset any stored non-100% value so users aren't stuck at a broken scale.
|
||||||
|
// When re-enabling: remove this effect AND re-enable the slider in Settings.tsx.
|
||||||
|
useEffect(() => {
|
||||||
|
if (uiScale !== 1.0) setUiScale(1.0);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.documentElement.style.zoom = String(uiScale);
|
document.documentElement.style.zoom = String(uiScale);
|
||||||
}, [uiScale]);
|
}, [uiScale]);
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ const CONTRIBUTORS = [
|
|||||||
contributions: [
|
contributions: [
|
||||||
'Nightfox.nvim theme group in Open Source Classics (PR #114)',
|
'Nightfox.nvim theme group in Open Source Classics (PR #114)',
|
||||||
'Switch reqwest to rustls-tls for cross-platform TLS (PR #112)',
|
'Switch reqwest to rustls-tls for cross-platform TLS (PR #112)',
|
||||||
|
'ICY stream metadata & AzuraCast Now Playing support (PR #146)',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
] as const;
|
] as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user