From b877dab7de8145ae552d2746ae1bdde8ba5cadd7 Mon Sep 17 00:00:00 2001 From: Brian Jian Zhao Date: Mon, 24 Feb 2020 10:46:27 +1100 Subject: [PATCH] refactor the code related to checking slider type --- .../session/settings/SessionSettingListItem.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ts/components/session/settings/SessionSettingListItem.tsx b/ts/components/session/settings/SessionSettingListItem.tsx index c84c047e5..e7bc66e4a 100644 --- a/ts/components/session/settings/SessionSettingListItem.tsx +++ b/ts/components/session/settings/SessionSettingListItem.tsx @@ -88,7 +88,7 @@ export class SessionSettingListItem extends React.Component { /> )} - {type === SessionSettingType.Slider && title === 'messageTTL' ? ( + {type === SessionSettingType.Slider && title === 'Message TTL' ? (
{

{`${currentSliderValue} Hours`}

- ):type === SessionSettingType.Slider ? ( + ):type === SessionSettingType.Slider && title === "Zoom Factor" ? (
- { this.handleSlider(sliderValue); }} /> +
-

{`% ${currentSliderValue} Zoom Level`}

-
-
+

{`% ${currentSliderValue} Zoom Level`}

+ + ): + null} @@ -144,7 +145,9 @@ export class SessionSettingListItem extends React.Component { sliderValue: value, }); - if(this.props.title !== 'messageTTL' && this.state.sliderValue!==null) { + console.log(this.props.title, 'from here') + + if(this.props.title === 'Zoom Factor' && this.state.sliderValue!==null) { window.setZoomFactor(this.state.sliderValue/100) }