hide mfa option if using older server

This commit is contained in:
Roland Osborne 2024-05-24 15:03:28 -07:00
parent f83cf8d25e
commit 2804de9972

View File

@ -225,18 +225,20 @@ export function Settings({ drawer }) {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={styles.drawerEntry} activeOpacity={1}> { state.mfaEnabled != null && (
<View style={styles.icon}> <TouchableOpacity style={styles.drawerEntry} activeOpacity={1}>
<MatIcons name="ticket-confirmation-outline" size={20} color={Colors.text} /> <View style={styles.icon}>
</View> <MatIcons name="ticket-confirmation-outline" size={20} color={Colors.text} />
<View style={styles.optionControl}> </View>
<TouchableOpacity activeOpacity={1} onPress={actions.toggleMFA}> <View style={styles.optionControl}>
<Text style={styles.optionText}>{ state.strings.mfaTitle }</Text> <TouchableOpacity activeOpacity={1} onPress={actions.toggleMFA}>
</TouchableOpacity> <Text style={styles.optionText}>{ state.strings.mfaTitle }</Text>
<Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.idleFill} </TouchableOpacity>
trackColor={styles.track} onValueChange={toggleMFA} /> <Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.idleFill}
</View> trackColor={styles.track} onValueChange={toggleMFA} />
</TouchableOpacity> </View>
</TouchableOpacity>
)}
<TouchableOpacity style={styles.drawerEntry} activeOpacity={1} onPress={actions.showLogin}> <TouchableOpacity style={styles.drawerEntry} activeOpacity={1} onPress={actions.showLogin}>
<View style={styles.icon}> <View style={styles.icon}>
@ -392,19 +394,23 @@ export function Settings({ drawer }) {
<Text style={styles.optionLink}>{ state.strings.logout }</Text> <Text style={styles.optionLink}>{ state.strings.logout }</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<View style={styles.divider} /> { state.mfaEnabled != null && (
<TouchableOpacity style={styles.entry} activeOpacity={1}> <View style={styles.divider} />
<View style={styles.icon}> )}
<MatIcons name="ticket-confirmation-outline" size={20} color={Colors.linkText} /> { state.mfaEnabled != null && (
</View> <TouchableOpacity style={styles.entry} activeOpacity={1}>
<View style={styles.optionControl}> <View style={styles.icon}>
<TouchableOpacity activeOpacity={1} onPress={toggleMFA}> <MatIcons name="ticket-confirmation-outline" size={20} color={Colors.linkText} />
<Text style={styles.optionLink}>{ state.strings.mfaTitle }</Text> </View>
</TouchableOpacity> <View style={styles.optionControl}>
<Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.disabledIndicator} <TouchableOpacity activeOpacity={1} onPress={toggleMFA}>
trackColor={styles.track} onValueChange={toggleMFA} /> <Text style={styles.optionLink}>{ state.strings.mfaTitle }</Text>
</View> </TouchableOpacity>
</TouchableOpacity> <Switch value={state.mfaEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.disabledIndicator}
trackColor={styles.track} onValueChange={toggleMFA} />
</View>
</TouchableOpacity>
)}
<View style={styles.divider} /> <View style={styles.divider} />
<TouchableOpacity style={styles.entry} activeOpacity={1} onPress={actions.showLogin}> <TouchableOpacity style={styles.entry} activeOpacity={1} onPress={actions.showLogin}>
<View style={styles.icon}> <View style={styles.icon}>