Bluesky app fork with some witchin' additions 💫

Disable autoplay by default if prefers-reduced-motion (#3671)

authored by danabra.mov and committed by

GitHub 24da3a8f 0847e275

+8 -2
+6
src/platform/detection.ts
··· 1 1 import {Platform} from 'react-native' 2 2 import {getLocales} from 'expo-localization' 3 + 3 4 import {dedupArray} from 'lib/functions' 4 5 5 6 export const isIOS = Platform.OS === 'ios' ··· 18 19 .map?.(locale => locale.languageCode) 19 20 .filter(code => typeof code === 'string'), 20 21 ) as string[] 22 + 23 + export const prefersReducedMotion = 24 + isWeb && 25 + // @ts-ignore we know window exists -prf 26 + !global.window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches
+2 -2
src/state/persisted/schema.ts
··· 1 1 import {z} from 'zod' 2 2 3 - import {deviceLocales} from '#/platform/detection' 3 + import {deviceLocales, prefersReducedMotion} from '#/platform/detection' 4 4 5 5 const externalEmbedOptions = ['show', 'hide'] as const 6 6 ··· 98 98 lastSelectedHomeFeed: undefined, 99 99 pdsAddressHistory: [], 100 100 disableHaptics: false, 101 - disableAutoplay: false, 101 + disableAutoplay: prefersReducedMotion, 102 102 }