feat: Swipe gestures on mobile have been improved, and are now enabled by default. You can turn them off from Preferences > General > Labs (#2321)
This commit is contained in:
@@ -8,6 +8,7 @@ import PreferencesSegment from '../../../PreferencesComponents/PreferencesSegmen
|
||||
import LabsFeature from './LabsFeature'
|
||||
import HorizontalSeparator from '@/Components/Shared/HorizontalSeparator'
|
||||
import { MutuallyExclusiveMediaQueryBreakpoints, useMediaQuery } from '@/Hooks/useMediaQuery'
|
||||
import { PrefDefaults } from '@/Constants/PrefDefaults'
|
||||
|
||||
type ExperimentalFeatureItem = {
|
||||
identifier: FeatureIdentifier
|
||||
@@ -30,11 +31,13 @@ const LabsPane: FunctionComponent<Props> = ({ application }) => {
|
||||
const [experimentalFeatures, setExperimentalFeatures] = useState<ExperimentalFeatureItem[]>([])
|
||||
|
||||
const [isPaneGesturesEnabled, setIsPaneGesturesEnabled] = useState(() =>
|
||||
application.getPreference(PrefKey.PaneGesturesEnabled, false),
|
||||
application.getPreference(PrefKey.PaneGesturesEnabled, PrefDefaults[PrefKey.PaneGesturesEnabled]),
|
||||
)
|
||||
useEffect(() => {
|
||||
return application.addSingleEventObserver(ApplicationEvent.PreferencesChanged, async () => {
|
||||
setIsPaneGesturesEnabled(application.getPreference(PrefKey.PaneGesturesEnabled, false))
|
||||
setIsPaneGesturesEnabled(
|
||||
application.getPreference(PrefKey.PaneGesturesEnabled, PrefDefaults[PrefKey.PaneGesturesEnabled]),
|
||||
)
|
||||
})
|
||||
}, [application])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user