chore: revert labs changes

This commit is contained in:
Aman Harwara
2023-04-26 19:05:52 +05:30
parent 51b2d8b115
commit ccac1494c2

View File

@@ -30,11 +30,11 @@ const LabsPane: FunctionComponent<Props> = ({ application }) => {
const [experimentalFeatures, setExperimentalFeatures] = useState<ExperimentalFeatureItem[]>([]) const [experimentalFeatures, setExperimentalFeatures] = useState<ExperimentalFeatureItem[]>([])
const [isPaneGesturesEnabled, setIsPaneGesturesEnabled] = useState(() => const [isPaneGesturesEnabled, setIsPaneGesturesEnabled] = useState(() =>
application.getPreference(PrefKey.PaneGesturesEnabled), application.getPreference(PrefKey.PaneGesturesEnabled, false),
) )
useEffect(() => { useEffect(() => {
return application.addSingleEventObserver(ApplicationEvent.PreferencesChanged, async () => { return application.addSingleEventObserver(ApplicationEvent.PreferencesChanged, async () => {
setIsPaneGesturesEnabled(application.getPreference(PrefKey.PaneGesturesEnabled)) setIsPaneGesturesEnabled(application.getPreference(PrefKey.PaneGesturesEnabled, false))
}) })
}, [application]) }, [application])
@@ -69,7 +69,7 @@ const LabsPane: FunctionComponent<Props> = ({ application }) => {
<LabsFeature <LabsFeature
name="Pane switch gestures" name="Pane switch gestures"
description="Allows using gestures to navigate" description="Allows using gestures to navigate"
isEnabled={!!isPaneGesturesEnabled} isEnabled={isPaneGesturesEnabled}
toggleFeature={() => { toggleFeature={() => {
void application.setPreference(PrefKey.PaneGesturesEnabled, !isPaneGesturesEnabled) void application.setPreference(PrefKey.PaneGesturesEnabled, !isPaneGesturesEnabled)
}} }}