fix(linux): guard webkit smooth scroll migration behind IS_LINUX

Migration key was written to localStorage on all platforms; the one-time
default-to-smooth logic is only relevant on Linux (WebKitGTK).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-18 11:25:09 +02:00
parent ba43ed867a
commit a8317f5877
+9 -6
View File
@@ -8,6 +8,7 @@ import {
type SubsonicServerIdentity, type SubsonicServerIdentity,
} from '../utils/subsonicServerIdentity'; } from '../utils/subsonicServerIdentity';
import { usePlayerStore } from './playerStore'; import { usePlayerStore } from './playerStore';
import { IS_LINUX } from '../utils/platform';
export interface ServerProfile { export interface ServerProfile {
id: string; id: string;
@@ -640,12 +641,14 @@ export const useAuthStore = create<AuthState>()(
// explicit toggle in Settings may turn it off (persisted in psysonic-auth). // explicit toggle in Settings may turn it off (persisted in psysonic-auth).
const wheelSmoothMigrationKey = 'psysonic-linux-webkit-smooth-v1'; const wheelSmoothMigrationKey = 'psysonic-linux-webkit-smooth-v1';
let wheelSmoothOneTime: { linuxWebkitKineticScroll?: boolean } = {}; let wheelSmoothOneTime: { linuxWebkitKineticScroll?: boolean } = {};
try { if (IS_LINUX) {
if (!localStorage.getItem(wheelSmoothMigrationKey)) { try {
wheelSmoothOneTime = { linuxWebkitKineticScroll: true }; if (!localStorage.getItem(wheelSmoothMigrationKey)) {
localStorage.setItem(wheelSmoothMigrationKey, '1'); wheelSmoothOneTime = { linuxWebkitKineticScroll: true };
} localStorage.setItem(wheelSmoothMigrationKey, '1');
} catch { /* ignore */ } }
} catch { /* ignore */ }
}
useAuthStore.setState({ useAuthStore.setState({
mixMinRatingSong: clampMixFilterMinStars(state.mixMinRatingSong as number), mixMinRatingSong: clampMixFilterMinStars(state.mixMinRatingSong as number),