mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 23:05:46 +00:00
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:
@@ -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),
|
||||||
|
|||||||
Reference in New Issue
Block a user